PULL API
Receive SMS messages via HTTP(S)
A mobile phone user sends an SMS with a codeword to Eurobate’s shortnumber 2030. The message is forwarded to your web server via HTTP(S) to an URL you specify for the particular codeword.
Possible parameters
You decide which URL to use, as well as the name of the parameter
Possible values | Parsed to |
---|---|
<parm>=GSM | Senders mobile number |
<parm>=KODEORD | The codeword – always the first word in the message. |
<parm>=TEKST | The message text – minus the codeword |
<parm>=MELDING | The whole message – including the codeword. |
<parm>=OPERATOR | Countrycode and operator name, for example “47-netcom” |
<parm>=OPNAVN | Operator name, for example ”netcom” |
<parm>=LAND | Country code, 47 for Norway |
<parm>=KORTNR | The shortnumber that the message was sendt to. Forexample 2030. |
<parm>=SUBNUMMER | The 10-digit part of a subnumber dedicated to the service if applicable. The number is provided by Eurobate and can be used as an alias for the codeword. |
Example
A user with the phone number 99999999 has sendt the SMS TBL hello
to 2030.
The codeword TBL is set to be forwarded to:
http://www.myserv.com/sms.php?gsm=GSM&melding=MELDING
The request sent to you will then be:
http://www.myserv.com/sms.php?gsm=99999999&melding=TBL+hello
Response
Something must be returned by your script for the request.
For example:
Thank you for your message
Response must be Content-type: text/plain
format. One message consists of
max 160 characters.
It is also possible to return more text than 160 characters, but the user will only be billed for the first message-part. Any subsequent message-parts will be invoiced you. If the message is more than 160 characters, and includes HTML “tags” (either < or >) then the user will receive an error message instead.
Billing
Pr. default, the subscriber will be billed whatever price is set on the codeword/service.
If you instead want to have separate prices for the message then
you can return the following in Content-type: text/plain
:
PRIS=The price-group (see below for valid price groups in Norway/Sweden)
FORMAT=Always 00
TEKST=The message text
For example, the following for a message that will bill the user NOK 2.00
PRIS=3
FORMAT=00
TEKST=This is a message
Valid price groups:
Price group | Value |
---|---|
0 | NOK 0,- Message will not be charged to the user’s phone, but you will get a bill from Eurobate for NOK 1.00 pr. message |
1 | 1,- |
2 | 1,50 |
3 | 2 |
4 | 3 |
5 | 4 |
6 | 5 |
7 | 6 |
8 | 6,50 |
9 | 7 |
10 | 8 |
11 | 9 |
12 | 10 |
13 | 11 |
14 | 12 |
15 | 13 |
etc. In whole kroners, up to 100,- kroner
Alternatively you can return the string NORETURN
. That will send nothing to the
mobile and you will be responsible for pushing any receipts to the user. (See
separate JSON API documentation for details.)
Returning errors
If you want to return an error message to the user, for example if they have written a
wrong code, then you can start the response with the string ERROR=
. This will bill
the user maximum NOK 3,- regardless of the service price.
Timeout
If nothing is returned from your server after 30 seconds the connection will time out and the user will receive an SMS with the text ”Grunnet en feil i tjenesten kunne ikke innholdet leveres.”
Statistics
You can check statistics for received messages on your codewords on https://kundeweb.eurobate.com when you get your username and password from Eurobate.
Stopping Subscription services
According to Norwegian law, any user may ask to be removed from subscription services at any time by simply sending an SMS with the codeword STOPP to the shortnumber 2030.
You are equally required to remove them from your service when there is no credit left on their mobile subscription.
To accommodate this, Eurobate will forward the mobile number to you when a stoprequest is received, or when the mobile subscriber has no money left on their card.
The users mobile number will be in the remove parameter. For example: https://www.myserv.com/sms.php?remove=99999999
It is important that you let us know if any of your services are subscription-type services when you order the codeword. Thank you!
Eurobate AS - www.eurobate.no