### MMS Push Message Example Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html An example of an MMS push message sent via HTTP, illustrating custom 'Emms-' headers and multipart content structure. This demonstrates how to format and send MMS data using the SKYLINE HTTP API. ```APIDOC POST /HTTP/1.1 Host:192.168.1.142:8899 Date:Thu,28 Mar 202409:47:10 GMT Emms-Subject:c3ViamvjdDAw;charset=US-ASCII Emms-From:Kzg2MTM3NTEWNjQ×Mjk=;type=PLMN;charset=UTF-8 Emms-To:ODYXMzU4MDI1NjgONw==;type=PLMN;charset=UTF-8 Keep-Alive:timeout=180 Connection:Keep-Alive content-Type:multipart/related;boundary=832817471092001110508;type="application/smil";start="<0.smil>" Content-Length:176603 --032817471092001110508 Content-Type:application/smil Content-ID:<0.smil> C -0328onte 1n t 7-471Typ0e 9 :i20011mage1/ j0p508eg ;name="ING_3337.jpg" --032817471092001110508 Content-Type:text/plain;charset=US-ASCII Content-Location:text_1.txt contenteo --032817471092001110508-- ``` -------------------------------- ### GET Status Request URL Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Specifies the URL format for sending a GET request to retrieve status information from the device. The 'url' parameter specifies the report URL, and 'period' controls the status reporting interval. ```APIDOC GET Status Request URL Used by the server to request status information from the device. URL Format: http://host:port/goip_get_status.html?url=xxx&period=0 Parameters: url (String): Specifies the report URL where the device should send status updates. Special characters require URL encoding. This parameter needs to be specified only once. period (Int): Sets the report period in seconds. A value > 0 means report status according to the specified period (minimum 60 seconds). A value of 0 cancels status reporting. Default: 60 seconds. Optional. ``` -------------------------------- ### Query SMS Statistics API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Details the HTTP GET request for querying SMS statistics. It specifies the URL structure, required parameters like version, username, password, ports, slots, and type of statistic, along with their data types and descriptions. ```APIDOC API Endpoint: Query SMS Statistics URL: http://host:port/goip_get_sms_stat.html?version=xxx&username=xxx&password=xxx&ports=xxx&slots=xxx&type=xxx Parameters: version: string (API version, e.g., '1.0', '1.1') - Required: No, Default: 1.0 username: string (Device Username) - Required: Yes password: string (Device password) - Required: Yes ports: string (Port numbers, e.g., 'all', '2', '1-2,4') - Required: No, Default: 'all' - 'all': all ports - '2': specify a single port - '1-2,4': comma-separated ports, '-' for ranges slots: string (Card slot number, e.g., 'all', '2', '1-2,4') - Required: No, Default: 'Current card' - 'Do not specify': current card - 'all': all card slots - '2': specify a single card slot - '1-2,4': comma-separated slots, '-' for ranges type: int (Statistic type) - Required: No, Default: 0 - 0: The last hour - 1: The last two hours - 2: today - 3: cumulative ``` -------------------------------- ### Query Call Statistics API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Allows clients to actively query device call statistics via HTTP GET requests. It specifies the URL structure, required parameters like host, port, authentication, and filtering options for ports, slots, and time types. The response format is a JSON object containing status codes, counts, and detailed statistical results. ```APIDOC URL: http://host:port/goip_get_call_stat.html?version=xxx&username=xxx&password=x&ports=xxx&slots=xxx&type=xxx Parameters: - host: Device IP address - port: Device webpage management port (default: 80) - version: API version (1.0, 1.1) - username: Device Username - password: Device password - ports: Specified port number(s). Examples: 'all', '2', '1-2, 4' - slots: Specified card slot number(s). Examples: 'all', '2', '1-2, 4', 'current card' - type: Statistic type. Values: 0 (last hour), 1 (last two hours), 2 (today), 3 (cumulative) Response: { "code": int, // Interface processing result code "reason": string, // Interface processing result reason "count": int, // Number of statistical results "stats": [ { "port": int, // Port number (value from 1) "slot": int, // Slot number (value from 1) "calls": int, // Number of calling "alerted": int, // Number of alerting "connected": int, // Number of connected calls "con_failed": int, // Number of failed calls "nc": string, // No Carriers success ratio ("n/m") "pdd": int, // PDD (Post Dial Delay) "acd": int, // ACD (Average Call Duration) "asr": int, // ASR (Automatic Speech Recognition) percentage "tcd": int, // Cumulative call duration (minutes) "act_tcd": int // Actual cumulative call duration (seconds) } // ... more stat results ] } ``` -------------------------------- ### API Version and Authentication Parameters Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Details the API version parameter and required authentication credentials for accessing the SKYLINE HTTP API. ```APIDOC API Version and Authentication: Parameters (URL or POST body): version (string): API version. '1.0' for compatibility with previous APIs, '1' for this document's specification. Default: '1.0'. Optional. username (string): Device username. Required. password (string): Device password. Required. ``` -------------------------------- ### Component State Parameters Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Describes parameters related to component states and buffering for status reporting and SMS caching. ```APIDOC Component State Parameters: sr_url_ (string): Status report forward URL. Optional. sr_cnt_ (integer): Max number of SMS results to keep in cache. If buffer reaches this value, reports are sent immediately. Default: 100. Optional. sr_prd (integer): Max time (in seconds) SMS results can be kept in cache. If time expires, reports are sent immediately. Default: 30. Optional. sms_url_ (string): SMS forward URL. Optional. sms_cnt_ (integer): Max number of SMS to keep in cache. If buffer reaches this value, buffered SMS are sent immediately. Must be > 1 for compatibility. Default: 1. Optional. sms_prd (integer): Max time (in seconds) SMS can be kept in cache. If time expires, SMS are sent immediately. Default: 30. Optional. ``` -------------------------------- ### Write ESIM Profile API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Handles the submission of ESIM profile data to the device. It requires authentication and specifies the port, slot, activation code, and confirmation code for the operation. ```APIDOC POST /goip_write_esims.html?version=xxx&username=xxx&password=xxx Host: device IP address Port: device web port (default 80, optional) Query Parameters: - version (string): API version. '1.0' for previous API compatibility, '1.1' for this document's description. - username (string): Device Username. Required. - password (string): Device password. Required. POST Data (JSON Array): Each item is a structure: - port (int): Port number (value from 1). Required. - slot (int): Slot number (value from 1). Required. - ac (string): Activation code. Required. - cc (string): Confirmation code. Required. Response (application/json;charset=utf-8): { "code": int, // Interface processing result code "reason": string, // Interface processing result reason "count": int, // Number of results "ports": [ { "port": int, // Port number (value from 1) "slot": int, // Slot number (value from 1) "status": int // Operation status: // 1 - Write request has been submitted // 2 - Current port is performing profile operation, submission failed // 3 - Other errors, submission failed } ] } ``` -------------------------------- ### Send Command API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Sends commands to the device, such as switching ports. The request includes command type and target ports, with a response indicating the operation status. ```APIDOC Send Command API URL: http://192.168.1.67:80/goip_send_cmd.html?Username=root&password=root Body: {"type":"command","op":"switch","ports":"2.02"} Response: { "code": 4, "reason": "OK" } ``` -------------------------------- ### SKYLINE HTTP Command Sending API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html This API allows servers to send commands to devices to change their status. It supports operations like locking/unlocking ports, switching SIM cards, rebooting modules, and controlling LEDs. Commands are sent via HTTP POST requests with a JSON payload. ```APIDOC URL: http://host:port/goip_send_cmd.html Parameters: Version: API version (e.g., 1.1) username: Device account Password: Device password Op: Operation description (get, set, lock, unlock, switch, reset, save, reboot, ledon, ledoff) par_name(n): Parameter name for get/set operations, can include array index. Sms_url: Destination URL for SMS push. Request Body (JSON Array): Content-Type: application/json;charset=utf-8 Example: [{"type":"command", "op":"lock", "ports":"1A,2B,3C,4-32"}, {"op":"switch", "ports":"2B"}] Data Structure: { "type": "string", // Message type (e.g., "command", "multiple") "op": "string", // Operation type (lock, unlock, switch, reset, save, reboot, multiple, ledon, ledoff) "ports": "string", // Port number(s) to operate (e.g., "1A", "all", "*"). Valid for lock/unlock/switch/reset/ledon/ledoff. "ops": [ // Array of commands, valid when op is "multiple" { "op": "string", // Operation type for sub-command "ports": "string" // Port number(s) for sub-command } ] } Supported Operations: - lock: Lock a port. - unlock: Unlock a port. - switch: Switch SIM card in a slot. - reset: Reboot a module. - save: Save configuration. - reboot: Reboot the device. - ledon: Turn on the LED. - ledoff: Turn off the LED. - multiple: Execute multiple commands in a single request. Notes: - For lock/unlock/switch operations, if SIM slot is not specified, the entire port is affected. - For reset operation, only the port number is relevant. ``` -------------------------------- ### SKYLINE HTTP API Security: Secure Session Establishment Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Details the interactive process for establishing a secure session for encrypted HTTP POST requests. This involves a handshake to negotiate encryption methods and exchange session IDs. ```APIDOC 3.1 Interactive Process: 1. Setting up a secure session: The client uses http://host:port/crypt_sess.json to request the device to set up a session. 2. Secure session establishment Reply: The device replies to the client's request after authentication. 3. Common interface request: After the session is established, the client submits data using ciphertext mode via HTTP POST. 4. Reply on the common interface: The device decrypts the POST data using the negotiated method and replies in plaintext. ``` ```APIDOC 3.2.1 Session Setup Request Parameters: - username: Device account. (Required: Y) - cnonce: Initial random string provided by the client. (Required: Y) - expires: Timeout value for the session, defaults to 180. (Required: N) - auth: Customer session ID (client-session-id). (Required: Y) - crypt: Encryption method used for the session. (Required: N) ``` ```APIDOC 3.2.2 Session Setup Response Parameters: - code: Integer result code (0 for Success, non-0 for failure). (Required: Y) - desc: String providing instructions or failure cause. (Required: Y) - Session: Device session ID (server-session-id). (Required: Y) - expires: Timeout value for the session, defaults to 180s. (Required: N) ``` ```APIDOC 3.2.3 Subsequent URL Request Parameters (after encrypted session): - seq: Sequence number, must be incremented for subsequent requests. (Required: Y) - auth: Customer session ID (client-session-id). (Required: Y) - session: Session ID returned by the device (server-session-id). (Required: Y) - expires: Timeout value, resets the session life cycle. (Required: N) ``` -------------------------------- ### SKYLINE SMS Sending API Overview Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Provides an overview of the SKYLINE HTTP API for SMS operations, including the base URL and general request handling for sending SMS messages. ```APIDOC API Endpoint: http://host:port/goip_post_sms.html Host: Device IP address Port: Device webpage management port (default: 80) Request Method: POST for sending SMS data. GET for querying task sending status. Content-Type Header for POST: application/json;charset=utf-8 URL Parameters (for GET requests): Not explicitly detailed in this section, but noted as appearing only in GET requests. POST Request Body: JSON format string consisting of one or more tasks. ``` -------------------------------- ### MMS Content Push API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Describes the mechanism for pushing received MMS content to a configured server address via HTTP POST. It details the configuration settings on the device and explains special HTTP header fields used for transmitting MMS metadata like subject, sender, and recipient. ```APIDOC MMS Push via HTTP POST: Configuration: - Enable MMS content push function. - Set the HTTP server address (URL) for receiving MMS content. HTTP POST Request Headers: - Emms-Subject: BASE64 encoded subject, with charset specified (e.g., UTF-8). - Emms-From: BASE64 encoded sender address (type: phone number/PLMN), with charset specified. - Emms-To: BASE64 encoded recipient address (type: phone number/PLMN), with charset specified. ``` -------------------------------- ### Query ESIM API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html API endpoint for querying ESIM information on a device. It supports specifying ports and returns detailed ESIM status, profile information, and operation status. The operation status indicates if a profile is being written or deleted. ```APIDOC API: SKYLINE HTTP APPLICATION INTERFACE Operation: Query ESIM URL: http://host:port/goip_get_esims.html?version=xxx&username=xxx&password=xxx&ports=xxx Method: GET Parameters: - version (string): API version. Default: '1.0'. '1.1' supports document description. - username (string): Device Username. Required: Yes. - password (string): Device password. Required: Yes. - ports (string): Specifies port numbers. Can be 'all', a single port (e.g., '2'), or a range/list (e.g., '1-2, 4'). Default: 'all'. Required: No. Response: Content-Type: application/json;charset=utf-8 { "code": int, // Interface processing result code "reason": string, // Interface processing result reason "count": int, // Number of statistical results "ports": [ { "port": int, // Port number (value from 1) "eid": string, // eUICC ID "esim_state": int, // 0 - no, 1 - yes (eID obtained correctly) "profiles": [ { "slot": int, // Slot number (value from 1) "enabled": int, // 0 - disabled, 1 - enabled "iccid": string, // ESIM corresponding ICCID "ac": string, // Activation code "cc": string, // Confirmation code "provider": string, // Name of service provider "exust": int, // 0 - no, 1 - yes (profile written to slot) "op": int, // 0 - no operation, 1 - writing, 2 - deleting "status": int, // 0 - No operation, 1 - Request submitted, 2 - In progress, 3 - Operation error "reason": string // Causes of operational errors } ] } ] } Notes: - Write and delete operations for ESIM are asynchronous. A successful HTTP request returns status 1 (request submitted). Use the query interface to check the actual operation status. ``` -------------------------------- ### Status Notification API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Configures the device to send status notifications to a specified URL at a given interval. It includes parameters for authentication and the notification endpoint. ```APIDOC Status Notification API URL: http://192.168.1.67:80/goip_get_status.html?url=http://192.168.1.142&period=60&username=root&password=root Response Example: { "sn": "", "type": "dev-status", "seq": 3, "expires": 60, "mac": "e0-30-f1-00-6c-55", "ipver": "10.10.16.68", "max-ports": 32, "max-slot": 4, "status": [ { "port": "1.01", "sim": "", "seq": 8, "st": 3, "cs": "898600", "opr": "46001 CHINA UNICOM GSM", "bal": "0.00" }, ... ] } ``` -------------------------------- ### Task Sending Response Structure Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Defines the JSON structure for the response when a task is sent. It includes a status code, reason, type, and an array of task statuses. ```APIDOC 6.3.2.3 Response Task sending is a JSON array composed by one or more task send status, Parameter “Content-Type” in HTTP head should set to “application/json;charset=utf- 8” . { "code": 200, "reason": "OK", "type": "task-status", "status": [ { "tid": "tid_1", "status": "0 OK" }, { "tid": "tid_n", "status": "2 Invalid Port" } ] } Status components state: Parameter | Data type | Description | Default | Required ----------|-----------|-------------|---------|---------- tid | Int | Task ID | None | Y status | String | Task status code (0:OK, 1:Invalid User, 2:Invalid Port, 3:USSD Expected, 4:Pending USSD, 5:SIM Unregistered, 6:Timeout, 7:Server Error, 8:SMS expected, 9:TO expected, 10:Pending Transaction, 11:TID Expected, 12:FROM Expected, 13:Duplicated TaskId, 14:Unauthorized, 15:Invalid CMD, 16:Too Many Task, 17:MMS Title expected, 18:Too Many MMS Attachments, 19:MMS Attachments expected, 20:MMS Attachments Cache size Overlimit) | None | Y If task status ID not equal to 0, then means this task not received by device. ``` -------------------------------- ### Device Status Notification (dev-status) Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Describes the JSON structure for device status notifications sent by the device to the SMS server. This message includes overall device information and status summaries. The Content-Type header must be set to 'application/json;charset=utf-8'. ```APIDOC Device Status Notification (dev-status) This message is sent by the device to the SMS server periodically or when certain conditions are met, containing the device's running status information. HTTP Request: Method: POST Content-Type: application/json;charset=utf-8 Message Body (JSON): { "type": "dev-status", "seq": 1, "expires": 180, "mac": "00-30-f1-01-02-03", "ip": "192.168.1.67", "max-ports": 32, "max-slots": 4, "status": [ {"port": "1A", ...}, {"port": "2B", ...}, ..., {"port": "32D", ...} ] } Parameters: type (String): Message type. Must be 'dev-status'. Required. seq (Int): Device status message sequence number, starting from 1. Required. expires (Int): Dev-status sending period in seconds. Default: 180s. Optional. mac (String): Device MAC address. Required. ip (String): Device IP address. Required. max-ports (Int): Total number of ports on the device. Required. max-slots (String): Total number of SIM slots on the device. Default: 1. Optional. status (Array): An array containing the status of each device port. See Port Status description for details. Required. ``` -------------------------------- ### SMS Task Management Operations Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Details the server-initiated operations for managing SMS tasks, including status queries, pausing, resuming, deleting, and general querying of tasks in the send queue. ```APIDOC Operations: 1. Sending Status Query: - Method: GET - Purpose: Query task sending status (e.g., success statistics, failure information, current sending count). 2. Pause SMS Task: - Purpose: Pause one or more SMS tasks waiting in the send queue. 3. Resume Paused SMS Task: - Purpose: Resume sending of one or more suspended SMS tasks. 4. Delete SMS Task: - Purpose: Delete one or more SMS tasks waiting in the send queue. 5. Query SMS Task: - Purpose: Query SMS tasks waiting in the send queue. ``` -------------------------------- ### Manage SMS Task State (Pause, Resume, Delete) Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Provides endpoints to control the execution state of SMS tasks. Supports pausing, resuming, and deleting tasks based on their task IDs (tids). ```APIDOC 6.4.6 Pause the SMS task URL: http://:80/goip pause sms.html?username=root&password=root Method: POST Body: { "tids": [2, 3] } 6.4.7 Resume the paused SMS task URL: http://:80/goip resume sms.html?Username=root&password=root Method: POST Body: { "tids": [2, 3] } 6.4.8 Delete the SMS task URL: http://:80/goip remove sms.html?Username=root&password=root Method: POST Body: { "tids": [2, 3] } ``` -------------------------------- ### Port Status Notification (port-status) Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Describes the JSON structure for individual port status notifications sent by the device to the SMS server immediately when a port's status changes. The Content-Type header must be set to 'application/json;charset=utf-8'. ```APIDOC Port Status Notification (port-status) This message is sent by the device to the SMS server immediately when any one port's status changes. HTTP Request: Method: POST Content-Type: application/json;charset=utf-8 Message Body (JSON): { "type": "port-status", "port": "2B", "seq": 1, "status": "3 OK", "bal": "100.00", "opr": "46000 China Mobile", "sn": "139xxxxxxxxx", "imei": "86xxxxxxxxxxxxx", "imsi": "xxx", "iccid": "xxx" } Parameters: type (String): Message type. Must be 'port-status'. Required. port (String): Describes the current working port and SIM slot (e.g., '1.01', '1.02', ..., '32.04'). Required. sim (String): SIM pool's identification. Optional. seq (Int): The port sequence number, incremented from port 1. Required. st (String): Port status code and detail. Possible values: 0: No SIM card 1: Exist idle SIM card 2: Registering 3: Registered 4: Call connected 5: No balance or alarm 6: Register failed 7: SIM card locked by device 8: SIM card locked by operator 9: Recognize SIM card error 11: Card Detected 12: User locked 13: Port inter-calling 14: Inter-calling holding 15: Access Mobile Network 16: Module Response timeout Required. bal (Float): SIM card balance (yy.mm). Required. opr (String): SIM card operator name and ID. Valid when 'st' is 3 or 4. Optional. sn (String): SIM card number. Optional. imei (String): IMEI of the SIM card. Optional. imsi (String): IMSI of the SIM card. Optional. iccid (String): ICCID of the SIM card. Optional. ``` -------------------------------- ### Receive SMS Message Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Describes how the device sends received SMS messages to a server via POST requests. Specifies the data format and attributes for received SMS. ```APIDOC 7 Receive the SMS Device will send SMS to server by POST request, while it gets SMS from operator. 7.2 Message description 7.2.2 Parameter Parameter | Description | Default | Required | Remark ----------|-------------|---------|----------|-------- version | API version | 1.1 | Y | This document describes specification support only 7.2.3 Data A JSON format string consisting of one or more short messages. The value of the HTTP header parameter "Content-Type" is "application/json;charset=utf-8". { "type": "recv-sms", "sms_num": n, "sms": [ [...], [...] ] } Attributes instructions: Parameter | Data type | Description | Default | Required ----------|-----------|-------------|---------|---------- type | String | Data type | None | Y (recv-sms) sms_num | String | Total SMS num | None | Y sms | Array | SMS array | None | Y SMS array elements: [0]: Delivery report flag (0: normal SMS, 1: Delivery report) [1]: Receive report ('1.01', '1.02') [2]: Timestamp when device got this SMS [3]: Sender (If Delivery report flag set to 1, then sender should be SMCC) [4]: Recipient (If Delivery report flag set to 1, then recipient should be the original recipient.) [5]: SMS content: Delivery report: "code scts", code is 0 for successful delivery, utf-8. Ordinary SMS: BASE64 encoding of utf-8. ``` -------------------------------- ### Query Received SMS Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Allows customers to actively query SMS messages received by the device using HTTP GET/POST requests. Specifies the URL, parameters, and query process. ```APIDOC 8 Query SMS Customers can actively query the SMS received by the device through HTTP GET/POST request. 8.1 Query process 1. Query all messages received by the device without query parameters (except for user-verified parameters). 2. Use the value of next_sms returned by the device as the value of the sms_id parameter to query subsequent SMS messages. 3. If the device restarts, return a different ssrc synchronization source ID and return to step 1. 4. Repeat step 2. 8.2 Message description 8.2.1 URL http://:/goip_get_sms.html?username=root&password=root&sms_id=xxx&sms_num=xxx host: Device IP address port: Device webpage management port, default value is 80. 8.2.2 Parameter Parameter | Description | Default | Required | Remark ------------|----------------------------------------------|---------|----------|-------- sms_id | Start SMS ID | 1 | N | 1: The first SMS ID received by the device sms_num | Specify the number of SMS to be queried | 0 | N | 0: Query all SMS sms_del | Delete the SMS that has been returned by the query | 0 | N | 0: Do not delete, 1: delete ``` -------------------------------- ### SIM Number Parameter Encoding Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Explains the logic for encoding SIM number parameters in HTTP requests. The parameter `sim_number(n)` uses `n` derived from port and slot numbers. ```APIDOC Reference: Information in HTTP message Body is a text, many imei parameters modify use '&' to connect. sim_number(n)=xxxx, n=(port_number-1)*slots_per_port+(slot_number-1) xxx = sim_numbers parameter Example: sim_number(192)=1358021178&sim_number(196)=123456762221 192 represents 25.01, where max-slot is 8, and the slot number for 01 is 1. So, 25.01 = (25-1)*8 + (1-1) = 192. 196 represents 25.05, max-slot is 8, and the slot number for 05 is 5. So, 25.05 = (25-1)*8 + (5-1) = 196. ``` -------------------------------- ### Modify IMEI Parameters API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Allows modification of IMEI parameters for SIM slots. Parameters are sent via POST request, with a mapping from port and slot numbers to the parameter index. ```APIDOC Modify IMEI Parameters API URL: http://IP:port/goip_send_cmd.html?username=xx&password=xx&op=set Method: POST Body: sim_imei(n)=xxx&sim_imei(n)=xxx - sim_imei(n): IMEI parameter for a specific slot. 'n' is calculated as (port_number-1)*slots_per_port + (slot_number-1). - xxx: The IMEI value. Example: sim_imei(21)=865847053403202&sim_imei(51)=865847053403213 - 21 means port 6, slot 2 ( (6-1)*4 + (2-1) = 21 ) - 51 means port 13, slot 4 ( (13-1)*4 + (4-1) = 51 ) Response: { "code": 0, "reason": "OK", "par_set": 2 } ``` -------------------------------- ### Delete ESIM Profile API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Handles the deletion of ESIM profiles from the device. It requires authentication and specifies the port and slot from which to delete the profile. ```APIDOC POST /goip_delete_esims.html?version=xxx&username=xxx&password=xxx Host: device IP address Port: device web port (default 80, optional) Query Parameters: - version (string): API version. '1.0' for previous API compatibility, '1.1' for this document's description. - username (string): Device Username. Required. - password (string): Device password. Required. POST Data (JSON Array): Each item is a structure: - port (int): Port number (value from 1). Required. - slot (int): Slot number (value from 1). Required. Response (application/json;charset=utf-8): { "code": int, // Interface processing result code "reason": string, // Interface processing result reason "count": int, // Number of results "ports": [ { "port": int, // Port number (value from 1) "slot": int, // Slot number (value from 1) "status": int // Operation status: // 1 - Deletion request has been submitted // 2 - Current port is performing profile operation, submission failed // 3 - Other errors, submission failed } ] } ``` -------------------------------- ### Query SMS Response Structure Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Defines the JSON structure returned when querying SMS messages. It includes operation codes, reason descriptions, synchronization source identifiers, SMS counts, and the actual SMS data, which can contain delivery report flags, timestamps, sender/recipient information, and base64 encoded UTF-8 SMS content. ```APIDOC Query SMS Response: { "code": int, // Operation code (e.g., 0 for OK) "reason": string, // Reason description (e.g., "OK") "ssrc": string, // Synchronization source identifier (changes per run) "sms_num": int, // Number of SMS queried "next_sms": int, // ID for the next SMS "data": array // Array containing SMS details } SMS Data Array Element: [ [0]: int, // Delivery report flag (0: normal SMS, 1: delivery report) [1]: string, // Receive report type (e.g., '1.01', '1.02') if flag is 1 [2]: int, // Timestamp when device received SMS [3]: string, // Sender (or SMCC if flag is 1) [4]: string, // Recipient (or original recipient if flag is 1) [5]: string // SMS content (UTF-8 BASE64 encoded, or delivery report status) ] ``` -------------------------------- ### Task Send Report Data Structure Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Specifies the JSON format for status report messages, detailing the number of reports and individual report attributes like task ID, SMS counts, and sending details. ```APIDOC 6.3.3.3 Data Status-report message is a JSON array composed by one or more task send report. Parameter “Content-Type” in HTTP head should set to “application/ json;charset=utf-8” . { "type": "status-report", "rpt_num": n, "rpts": [ { "tid": "tid_1", ... }, { "tid": "tid_n", ... } ] } Components state: Parameter | Data type | Description | Default | Required ----------|-----------|-------------|---------|---------- type | string | Message type | None | Y (status-report) rpt_num | string | Report num | 1 | Y rpts | Array | Detail status report | None | Y Attributes reported in json data: Parameter | Data type | Description | Default | Required ----------|-----------|-------------|---------|---------- tid | Int | related task ID | None | Y sending | Int | total num of SMS in sending | None | Y sent | Int | total num of SMS successfully send | None | Y failed | Int | total num of SMS failed send | None | Y unsent | Int | total SMS in cache waiting for send | None | Y sdr | array | Successfully send details (one list for one num) | | [0]: recipients num index (int), [1]: num (string), [2]: SMS sending port (string), [3]: SMS send timestamp in UTC time (int) | None | N fdr | array | Fail send details (one num one list) | | [0]: recipients num index (int), [1]: num (string), [2]: SMS sending port (string), [3]: SMS send timestamp in UTC time (int), [4]: Progress reason (code+details), [5]: Carrier reason (code+description) | None | N Tips: 1. tid related to the task ID in the send-sms message. 2. sending, sent, failed are accumulated num in one task. 3. Sdr(successfully send record) list records between 2 status-report, server should keep before details. 4. fdr(failed detail record) list records between 2 status-report, server should keep before details. ``` -------------------------------- ### Add SIM Card Numbers API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Enables adding or updating SIM card numbers associated with device ports. This is done via a POST request with the SIM number mapped to the port and slot. ```APIDOC Add SIM Card Numbers API URL: http://ip:port/goip_send_cmd.html?username=XXX&password=XXX&op=set Method: POST Body: sim_number(n)=xxx&sim_number(n)=xxx - sim_number(n): SIM number for a specific slot. 'n' is calculated as (port_number-1)*slots_per_port + (slot_number-1). - xxx: The SIM card number. Response: { "code": 0, "reason": "OK", "par_set": 2 } ``` -------------------------------- ### Pause SMS Task API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Details the API endpoint for pausing SMS tasks, including the URL, required parameters (version, username, password), and the expected JSON data format for the request body. ```APIDOC 6.3.4 Pause the SMS task 6.3.4.1 URL http://host:port/goip_pause_sms.html host: Device IP address port: Device webpage management port, default value is 80. 6.3.4.2 Parameter Parameter | Description | Default | Required | Remark ----------|-------------|---------|----------|-------- version | API version | 1.1 | Y | This document describes specification support only username | Device username | None | Y | password | Device password | None | Y | 6.3.4.3 Data The data (the body segment of the HTTP message) is a JSON format string consisting of one or more tasks, and the value of the HTTP header parameter "Content-Type" is “application/json;charset=utf-8” . ``` -------------------------------- ### Query SMS Task Status Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Retrieves the status and details of SMS tasks. Allows filtering and fetching task information. ```APIDOC 6.4.9 Query the SMS task URL: http://:80/goip get tasks.html?version=1.1&username=root&password=root&port=1&pos=0&has content=1 Method: GET Response: { "code": 200, "reason": "OK", "total_num": 5, "task_num": 5, "tasks": [ { "tid": 2, "state": 0, "from": "", "to": "13686876820", "chs": "utf8", "coding": 0, "sms": "hello123" }, { "tid": 3, "state": 0, "from": "", "to": "13686876820", "chs": "utf8", "coding": 0, "sms": "hello123" }, { "tid": 4, "state": 0, "from": "", "to": "10010", "chs": "utf8", "coding": 0, "cme": "CYVF" } ] } ``` -------------------------------- ### SMS Sending POST Request Body Structure Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html Defines the JSON structure for the POST request body used to send SMS messages, including the main task object and its components. ```APIDOC POST Body JSON Structure: { "type": "send-sms", "task_num": n, // Total number of tasks "tasks": [ { "tid": tid_1, ... }, { "tid": tid_2, ... }, ... { "tid": tid_n, ... } ] } Parameters: type (string): Message type. Must be "send-sms". task_num (integer): Total number of tasks in the 'tasks' array. Required. tasks (array): An array of specific SMS send task objects. Required. ``` -------------------------------- ### Resume Paused SMS Task API Source: https://github.com/starkryan/docssky/blob/main/NEW SKYLINE Gateway HTTP API(V2.4.0)EN(2).html API endpoint to resume one or more paused SMS tasks. It requires authentication and accepts a JSON body containing task IDs. The response indicates the status of each task. ```APIDOC URL: http://host:port/goip_resume_sms.html host: device IP address port: device web port (default 80, optional) Parameters: version: API version (default: 1.1, required: Y) username: Device username (required: Y) password: Device password (required: Y) Data (Request Body): Content-Type: application/json; charset=utf-8 Format: JSON array of task IDs. Example: {"tids": [tid1, tid2, ..., tidn]} Attributes: tids (String): The task ID to be restored. If empty, restores all sending tasks. Response Body: Content-Type: application/json; charset=utf-8 Format: JSON array of task processing results. Example: {"code": 200, "reason": "OK", "results": [{"tid": tid_1, "status": "0 OK"}, ..., {"tid": tid_n, "status": "2 Invalid Port"}]} Attributes: code (Int): Interface processing result code. reason (String): Interface processing results. results (Array): Task processing results. tid (Int): Task ID. status (String): Task status code and description. 0: OK 1: Invalid User 2: Invalid Port 3: USSD Expected 4: Pending USSD 5: SIM Unregistered 6: Timeout 7: Server Error 8: SMS expected 9: TO expected 10: Pending Transaction 11: TID Expected 12: FROM Expected Note: If task status ID is not 0, the task was not received by the device. ```