Introduction

With the SMS API, anyone can build reliable SMS messaging services using our infrastructure. It is available as a free demo version too. Send some test SMS messages and experiment with the API before taking it into production. In your API Store account you can apply to take the SMS API into production.


API specification

Test the API on SwaggerHub


Base URL

https://api-prd.kpn.com/messaging/sms-kpn/v1


Conceptual model

Conceptual model


Definitions

SMS

SMS is an abbreviation of Short Message Service. It's a service on mobile phones to send and receive short messages.


API workflow

API workflow


Features and constraints

Features

  • Send a text message to another mobile phone number.

Constraints

  • No images can be sent with SMS.
  • Messages longer than 160 characters will be sent as multiple SMS messages.
  • With this API, messages can only be sent to mobile phones registered in the Netherlands. So the country code is locked to +31. Also 097 range is allowed.
    Note: 060xxxxxxx, 067xxxxxxx and 069xxxxxxx are not valid mobile numbers.
  • A single message can be sent to a single recipient. Bulk messaging will be added in the future.


How to...

Send SMS

Send an SMS by calling the POST /send endpoint of the SMS API in Swaggerhub or Postman.

Note: Keep in mind that messages can only be sent to Dutch mobile phones (country code +31).


Create your payload for the request using below snippet:

^^Request example^^
{
  "sender": "KPN API",
  "messages": [
    {
      "mobile_number": "06xxxxxxxx or +316xxxxxxxx",
      "content": "Hi from KPN!"
    }
  ]
}


The payload uses following parameters:

Parameter Description
sender A text that should resemble the sender's origin. This string can have a maximum length of 11 characters.
mobile_number The mobile phone number of the addressee. Use the country code +31 at the start.
content Put your message here. Long messages will be split into multiple SMS.

SwaggerHub:

  1. Select POST /send.
  2. Click Try it out.
  3. Edit the body parameter by providing the payload snippet above. In the payload change the content, mobile_number and sender to your own good. Make sure the content-type is set to application/json.
  4. Click Execute.
  5. Check the response code and message.

Postman:

  1. Select (POST) /send.
  2. In the Body section, set the type to raw and insert the payload snippet above. In the payload change the content, mobile_number and sender to your own good. Make sure the content-type is set to application/json.
  3. Click Send.
  4. Check the response code and message.

Result example:

^^Response example^^
{
  "document_id": "b4e905d4-774c-4c83-8360-01427e17a33a",
  "status": "OK"
}


Return codes

Code Description
200 Success.
201 Created.
202 Accepted.
302 Found. Link in location header.
400 Bad request.
401 Unauthorized.
403 Forbidden.
404 Not found.
405 Method not allowed.
412 Precondition failed.
429 Too many requests.
500 Internal server error.
502 Bad gateway.
503 Service unavailable.

Mopinion feedback