API Documentation
Send SMS example (get):
https://api.sveve.se/SMS/SendMessage?user=xxx&passwd=xxx&to=xxx&msg=Text&f=json
Parameter | Type | Max length | Mandatory | Default | Description |
---|---|---|---|---|---|
user | String | true | Username | ||
passwd | String | true | API password. You find this in the welcome e-mail from Sveve | ||
to | String | true | Receivers mobile number (comma separated if multiple), and/or existing group name | ||
msg | String | 1071 | true | Message text, UTF-8 encoded. | |
from | String | 11 | false | 27333 | Sender showing on receivers phone (eg. company name or your mobile number). No special characters. Minimum 3 characters is recommended to support iPhone. |
date_time | String | 12 | false | Date/time for scheduled message. Format: yyyyMMddttmm. Eg: 202310061315 (6. okt. 2023 @ 13:15). NB! max 5000 characters in "to"-parameter for scheduled messages. | |
ref | String | 36 | false | Your own reference. This will be included in delivery reports. | |
f | String | false | xml | Return format, valid options: json, xml | |
test | Boolean | false | false | Set this to 'true' for testing without sending SMS |
Max GET request size: 6900 characters
3 alternatives for POST:
1. Body JSON
Three options. The examples shows only some of the parameters, however all parameters are supported.
Option 1 (single message to one or more recipients):
{ "user": "username", "passwd": "api-password", "to": "number1, number2, ..", "msg": "Message text", "from": "MyCompany", "f": "json", "test": false }
Option 2 (single message to one or more recipients):
{ "request": { "user": "username", "passwd": "api-password", "to": "number1, number2, ..", "msg": "Message text", "from": "MyCompany", "f": "json", "test": false } }
Option 3 (multipple messages):
{ "user": "username", "passwd": "api-password", "f": "json", "test": false, "messages": [ { "to": "number1", "msg": "Message text 1", "from": "MyCompany" }, { "to": "number2", "msg": "Message text 2", "from": "MyCompany" } ] }
2. Body parameter
Form-data parameters
3. URL parameter
Same as GET but with POST as method. Parameters in URL, not in request body.
Set ContentType=UTF-8 in all POST requests.
Return from SMS requests
Each request will return some information, both for GET and POST. We recommend using JSON as return format (f=json).
Successful (2 messages sent):
{ "response": { "msgOkCount": 2, "stdSMSCount": 4, "ids": [ 42824111, 42824112 ] } }
Failed (no messages sent):
{ "response": { "msgOkCount": 0, "stdSMSCount": 0, "fatalError": "Feil brukernavn/passord", "ids": [] } }
Partial success (1 message sent and 2 rejected):
{ "response": { "msgOkCount": 1, "stdSMSCount": 1, "errors": [ { "number": "1792873691", "message": "Brukeren har ikke tilgang til å sende meldinger til dette landet" }, { "number": "63987654", "message": "Telefonnummeret er ikke et mobilnummer" } ], "ids": [ 42824387 ] } }
Response object
Key | Type | Description |
---|---|---|
msgOkCount | Integer | Number of messages sent |
stdSMSCount | Integer | Total number of SMS units for this request. One SMS unit is limited to 160 characters. |
fatalError | String | Error description if request failed |
errors | Array | Error description if request partial failed |
ids | Array | IDs for sent messages. The order matches the mobile number order in request. |
Charset and characters per sms unit
The following characters are part of the GSM 7-bit specification. For these characters each sms unit contains 160 characters. For longer messages each unit contains 153 characters because 7 characters are used for header in each part. The header is essential for correct unit assembly order on the receivers phone. Sveve supports messages up to 1071 characters. If other characters exists in the message text, each unit will contain 70 characters. Sveve supports all Unicode-characters with UTF-8 encoding, including emojis.
GSM-7
@£$¥èéùìòÇØøÅåΔ_ΦΓΛΩΠΨΣΘΞ^{}\[~]|€ÆæßÉ!"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüàConcurrent request limitations
To ensure a reliable and fast service, there is a limit on number of concurrent requests from each account.
The limit is 5 concurrent API-requests
Tips on how to setup the integration:
- Read the response on the previous request before sending the next
- If the limit is reached the server will respond with http status 429 (Too Many Requests)
- Every request only takes a few milliseconds. You can send as many messages as you like, but you need to limit the number of concurrent requests, or handle the 429 status.
Need more concurrent requests?
If you need to increase the concurrent request limit, send us on e-mail: post@sveve.se. This could be if you send requests from multiple servers or if you have other reasons to make multiple concurrent requests.
If you need to increase the concurrent request limit, send us on e-mail: post@sveve.se. This could be if you send requests from multiple servers or if you have other reasons to make multiple concurrent requests.