flespi Modems API
API to manage modems. [Modem](https://flespi.com/kb/modem-instance-to-send-sms) can be used to send commands as SMS messages to devices. Depending on the modem type some modems require ICCID to be specified in device configuration in phone_number field and some require phone number in international format (starts with '+'). If you have multiple modems created in your account SMS delivery will be performed through modem with the highest priority first. If it fail, than modem with lower priority will be attempted for the delivery and so on. A special modem with the configuration.type = "flespi" is provided by default but allows sending a limited quantity of SMS messages (10 SMSes in Free plan). You can create only one modem of such type and you can delete and create it anytime without any additional configuration. Check the details about the number of SMS messages available in the Free and Commerical plans on the [platform pricing](https://flespi.com/pricing) page. All actions with modems are reported to the common [logs subsystem](https://flespi.io/docs/#/platform/logs) with the following possible event codes: Event code | Description -----|------ 200|SMS (delivery receipt) was received via modem 201|SMS was sent via modem 202|modem has successfully connected to SMS gateway 203|modem has lost connection to SMS gateway 204|failed to connect to SMS gateway 205|failed to send SMS via modem If SMS was received via modem (event_code=200), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- address | SMS source address that sent this message timestamp | timestamp type | hex or text text | textual SMS content (for text messages only) hex | hex representation of binary SMS content (for binary messages only) If SMS was sent via modem (event_code=201), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- address | SMS destination address that should receive this message type | hex or text text | textual SMS content (for text messages only) hex | hex representation of binary SMS content (for binary messages only) send_code | resulting code for send operation, zero if no errors sender_cid | subaccount ID from which send request originated (typically it is ID of subaccount where the device to which SMS was sent is located in) If failed to connect to SMS gateway (event_code=204), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- error_text | error description If failed to send SMS via modem (event_code=205), you can expect the following additional parameters in the log record: Field name | Meaning ----------------------|-------- address | SMS destination address that should receive this message type | hex or text text | textual SMS content (for text messages only) hex | hex representation of binary SMS content (for binary messages only) send_code | resulting code for send operation sender_cid | subaccount ID from which send request originated (typically it is ID of subaccount where the device to which SMS was sent is located in) error_text | error description You can expect the following additional values for send_code parameter: Send code | Description -----|------ -5|Address type is not supported by the current modem -4|Internal error -3|No modem available -2|Error from SMS gateway, see special 'error_text' field for error description -1|No more SMS available for current period 0|SMS accepted for delivery by SMS gateway