NAV
bash javascript php python

SMS Service Center API v2

Welcome to the SMS Service Center API v2 documentation.

This documentation should contain all information required to make use of the API.

Base URL

All URL's referenced in this API documentation have this base URL.

SMS Service Center API Base URL

https://www.smsservicecenter.nl/

Retrieving your API code

Create an account on SMS Service Center and go to the API page in the Account menu.

An API key can be generated on that page.

Authentication

Authenticating the with API is done by adding a bearer header to each request that requires authentication.

All endpoints listed in this documentation with a Requires authentication badge requires this header to be set.

Make sure to replace {token} with the actual API token you received from the SMS Service Center application.

Authentication example

curl -X GET \
    -G "<endpoint_url>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "<endpoint_url>"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    '<endpoint_url>',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '<endpoint_url>'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Credits

Get available credits

Requires authentication

This API endpoint returns all remaining SMS credits the user has left.

Example request:

curl -X GET \
    -G "https://www.smsservicecenter.nl/api/v2/credits" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://www.smsservicecenter.nl/api/v2/credits"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://www.smsservicecenter.nl/api/v2/credits',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://www.smsservicecenter.nl/api/v2/credits'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "details": 3
}

HTTP Request

GET api/v2/credits

Packets

Get all available packets

This API endpoint returns all currently available packets in SMS Service Center.

Take note that the prices returned in the endpoint are stored as an integer and should therefor be divided by 100 to get the actual value in euro's.

Example request:

curl -X GET \
    -G "https://www.smsservicecenter.nl/api/packets" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://www.smsservicecenter.nl/api/packets"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://www.smsservicecenter.nl/api/packets',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://www.smsservicecenter.nl/api/packets'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "name": "Pakket Nano",
            "slug": "nano",
            "uuid": "d5d728d8-2add-46f2-9de3-4ef99615e668",
            "price": 1250,
            "credits": 50,
            "url": "https:\/\/www.smsservicecenter.nl\/order\/checkout\/nano"
        },
        {
            "name": "Pakket Micro",
            "slug": "micro",
            "uuid": "cc5372ba-a84b-4765-b005-8ba667881310",
            "price": 2000,
            "credits": 100,
            "url": "https:\/\/www.smsservicecenter.nl\/order\/checkout\/micro"
        },
        {
            "name": "Pakket Mini",
            "slug": "mini",
            "uuid": "2e8ae38d-6d82-4c23-aaf5-f3a2ab0d3244",
            "price": 3000,
            "credits": 200,
            "url": "https:\/\/www.smsservicecenter.nl\/order\/checkout\/mini"
        },
        {
            "name": "Pakket Maxi",
            "slug": "maxi",
            "uuid": "b9109a6c-d9b1-42c7-a978-c5bd28ef6dd2",
            "price": 4800,
            "credits": 400,
            "url": "https:\/\/www.smsservicecenter.nl\/order\/checkout\/maxi"
        },
        {
            "name": "Pakket Mega",
            "slug": "mega",
            "uuid": "6483e5a6-670a-4f28-8d31-10becb014c7f",
            "price": 10000,
            "credits": 1000,
            "url": "https:\/\/www.smsservicecenter.nl\/order\/checkout\/mega"
        },
        {
            "name": "Pakket Giga",
            "slug": "giga",
            "uuid": "976425b0-83cc-47ee-8ef6-730d9d792e0f",
            "price": 80000,
            "credits": 10000,
            "url": "https:\/\/www.smsservicecenter.nl\/order\/checkout\/giga"
        }
    ]
}

HTTP Request

GET api/packets

Send Messages

Sends a message

Requires authentication

This API endpoint sends a message to the given recipients.

Example request:

curl -X POST \
    "https://www.smsservicecenter.nl/api/v2/send" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"numbers":"perspiciatis","message":"sint","sendname":"labore"}'
const url = new URL(
    "https://www.smsservicecenter.nl/api/v2/send"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "numbers": "perspiciatis",
    "message": "sint",
    "sendname": "labore"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://www.smsservicecenter.nl/api/v2/send',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'numbers' => 'perspiciatis',
            'message' => 'sint',
            'sendname' => 'labore',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://www.smsservicecenter.nl/api/v2/send'
payload = {
    "numbers": "perspiciatis",
    "message": "sint",
    "sendname": "labore"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "status": "success",
    "details": {
        "messageid": "f89d33b3-da08-40fe-b4be-182a381b8e77",
        "testmode": true
    }
}

Example response (200):

{
    "status": "error",
    "message": "Missing parameters"
}

HTTP Request

POST api/v2/send

Body Parameters

Parameter Type Status Description
numbers string required The numbers to send the message to
message string required The message to send
sendname string optional optional The sendname to use while sending the message

Sendname

Get the default sendname

Requires authentication This API endpoint returns the default sendname to be included with messages to be send when no specific sendname has been given.

Example request:

curl -X GET \
    -G "https://www.smsservicecenter.nl/api/v2/sendname" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://www.smsservicecenter.nl/api/v2/sendname"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://www.smsservicecenter.nl/api/v2/sendname',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://www.smsservicecenter.nl/api/v2/sendname'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "error",
    "message": "Invalid request"
}

HTTP Request

GET api/v2/sendname

Updates the default sendname

Requires authentication This API endpoint updates the default sendname for the current user.

The sendname may only contain alphanumeric characters with a maximum of 11 characters.

Example request:

curl -X POST \
    "https://www.smsservicecenter.nl/api/v2/sendname" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"sendname":"NewName"}'
const url = new URL(
    "https://www.smsservicecenter.nl/api/v2/sendname"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "sendname": "NewName"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://www.smsservicecenter.nl/api/v2/sendname',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'sendname' => 'NewName',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://www.smsservicecenter.nl/api/v2/sendname'
payload = {
    "sendname": "NewName"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "status": "success",
    "details": "NewName"
}

Example response (200):

{
    "status": "error",
    "message": "Invalid sendname received"
}

HTTP Request

POST api/v2/sendname

Body Parameters

Parameter Type Status Description
sendname string required The new sendname to use

Sent Messages

Get sent messages

Requires authentication This API endpoint returns a list of all sent messages for the current user. This list will only contain messages that have been sent in the last 30 days. This endpoint is limited to return a maximum of 50 messages per request.

Example request:

curl -X GET \
    -G "https://www.smsservicecenter.nl/api/v2/history" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
const url = new URL(
    "https://www.smsservicecenter.nl/api/v2/history"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://www.smsservicecenter.nl/api/v2/history',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://www.smsservicecenter.nl/api/v2/history'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "details": {
        "messages": [
            {
                "id": "58d8e9b6-e12b-4c07-bed6-ce766662c7f6",
                "uuid": "58d8e9b6-e12b-4c07-bed6-ce766662c7f6",
                "date": "Thursday 1 January 2020 01:00",
                "datetime": "2020-01-01T00:00:00.000000Z",
                "sendname": "Sendname",
                "message": "This is a testmessage.",
                "count": 1
            }
        ],
        "totalpages": 1,
        "currentpage": 1,
        "items_per_page": 50
    }
}

HTTP Request

GET api/v2/history

URL Parameters

Parameter Status Description
page optional The page number to get the results for

Errors

The SMS Service Center API v2 always responds with a status key in it's JSON response.

If the value of this key is not success an additional key message will be added to the JSON response with the error message.