Jump to content

This is the support site for Andrews & Arnold Ltd, a UK Internet provider. Information on these pages is generally for our customers but may be useful to others, enjoy!

SMS API: Difference between revisions

==Inbound==
[[File:InboundSMS.png|none|frame|Inbound SMS option on Control Pages]]
 
You list one or more ''targets'' for your SMS, separated by a space.
We work out what type of target from the format.
The targets can also be prefixed by a special character to impact the format of how the message is sent.
 
===Email===
You may specify an email address, e.g. ''localpart''@''hostname' and we'll send the messages by email.
The prefix format + may be used to force mobile numbers too be E.123 (+ prefix) formatted and an ISO8601 timestamp.
 
===Toot===
You may specify a fediverse address, e.g. @''name''@''hosthostname'' to get messages as a toot (''direct mention'').
The prefix format + may be used to force mobile numbers too be E.123 (+ prefix) formatted and an ISO8601 timestamp.
 
===Mobile===
If you put an entry starting http:// or https:// then we will attempt to send the SMS to you using HTTP (or HTTPS). We recommend https for privacy.
 
If the URL ends with a ? or & then an HTTP GET is done with a set of form fields (i.e. name=value) containing information about the text. Using & allows you to add some specific fields first (which may be sensible to test the HTTP request came from us). If the URL does not end ? or &, then an HTTP POST is done using URL encoded form data.
 
The fields posted are as follows, but additional fields may be added from time to time.
! oa
| The sending number (see below).
|-
! ''via''
| (If relayed) the original ''da'' if the message has been forwarded by us from one mobile number to another.
|-
! ''udh''
|}
 
You will note that we have tried to use field names to match GSM 03.40 values. Other values may be included. For legacy reasons you can prefix the URL specified with a * to also send the older field names of timestamp, originator, destination, message.
Naming comes from: https://en.wikipedia.org/wiki/GSM_03.40
 
The prefix format * may be used to also send the older field names of ''timestamp'', ''originator'', ''destination'', ''message'', but we recommend updating your scripts to use the new field names.
You will note that we have tried to use field names to match GSM 03.40 values. Other values may be included. For legacy reasons you can prefix the URL specified with a * to also send the older field names of timestamp, originator, destination, message.
 
We support UTF-8 coding of the full GSM 7 bit character set (including £$¥èéùìòÇØøÅåΔ_ΦΓΛΩΠΨΣΘΞÆæÉÄÖÑܧäöñüà€¡¿) and from UCS16 messages and UTF-16 surrogates. Not all of our SMS interconnects handle all of the coding, so we send the message as best we can.
 
The response text starts with either ERR: and an error message or OK:
 
example:
https://your.domain/yourscript.ext
 
We will then post or get using the field names as above.
 
===SIM===
WhenWhere we offer SIM services (e.g. SIP2SIM) you can simply put the ICCID (long number starting 89) of the target SIM to have it delivered to the SIM.
 
==Outbound messages==