Sveve logo

API Documentation

Send SMS example (get):
https://api.sveve.dk/SMS/SendMessage?user=xxx&passwd=xxx&to=xxx&msg=Text&f=json
ParameterTypeMax lengthMandatoryDefaultDescription
userStringtrueUsername
passwdStringtrueAPI password. You find this in the welcome e-mail from Sveve
toStringtrueReceivers mobile number (comma separated if multiple), and/or existing group name
msgString1071trueMessage text, UTF-8 encoded.
fromString11false27333Sender showing on receivers phone (eg. company name or your mobile number). No special characters. Minimum 3 characters is recommended to support iPhone.
date_timeString12falseDate/time for scheduled message. Format: yyyyMMddttmm. Eg: 202310061315 (6. okt. 2023 @ 13:15). NB! max 5000 characters in "to"-parameter for scheduled messages.
refString36falseYour own reference. This will be included in delivery reports.
fStringfalsexmlReturn format, valid options: json, xml
testBooleanfalsefalseSet 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
KeyTypeDescription
msgOkCountIntegerNumber of messages sent
stdSMSCountIntegerTotal number of SMS units for this request. One SMS unit is limited to 160 characters.
fatalErrorStringError description if request failed
errorsArrayError description if request partial failed
idsArrayIDs 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.
GSM-7
@£$¥èéùìòÇØøÅå?_FG?O??ST?^{}\[~]|ÆæßÉ!"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà
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.
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.dk. This could be if you send requests from multiple servers or if you have other reasons to make multiple concurrent requests.
2006 - 2023 © Sveve AS | Personvernerklæring