Pricing
The price of one SMS in each country you can send to. Every network in a country costs the same.
The price object
| Field | Type | Description |
|---|---|---|
object | string | Always price. |
country | string | |
price_per_sms | Money | One SMS (one part) to any network in the country. |
Example
json
{
"object": "price",
"country": "KE",
"price_per_sms": {
"amount": 80,
"currency": "KES",
"display": "KES 0.80"
}
}1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
List prices
GET
/v1/pricingScope: pricing:readThe price of one SMS in each country the organisation can send to. Every network in a country costs the same.
Returns
200 OK The prices. A list of price objects.
Errors
Like any request, it can answer invalid_api_key key_revoked key_expired scope_missing ip_not_allowed browser_requests_not_allowed api_blocked account_suspended rate_limited internal_error request_timeout.
Request
bash
curl https://api.semalink.africa/v1/pricing \
-H "Authorization: Bearer $SEMALINK_API_KEY"1
2
2
js
const response = await fetch('https://api.semalink.africa/v1/pricing', {
headers: {
Authorization: `Bearer ${process.env.SEMALINK_API_KEY}`,
},
});
const page = await response.json();
console.log(response.status, page);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
python
import os
import requests
response = requests.get(
"https://api.semalink.africa/v1/pricing",
headers={
"Authorization": f"Bearer {os.environ['SEMALINK_API_KEY']}",
},
timeout=30,
)
page = response.json()
print(response.status_code, page)1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
php
<?php
$ch = curl_init('https://api.semalink.africa/v1/pricing');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SEMALINK_API_KEY'),
],
]);
$page = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
print_r($page);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Response
json
{
"object": "list",
"data": [
{
"object": "price",
"country": "KE",
"price_per_sms": {
"amount": 80,
"currency": "KES",
"display": "KES 0.80"
}
}
],
"has_more": false,
"next_cursor": null
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
json
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "This API key isn't one we know. Check it was copied whole, or make a new one in Developer > API keys.",
"doc_url": "https://docs.semalink.africa/errors#invalid_api_key",
"request_id": "req_5f1d0c2e8a9b4c3d9e7f6a5b4c3d2e1f"
}
}1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
json
{
"error": {
"type": "permission_error",
"code": "scope_missing",
"message": "This API key doesn't have the pricing:read scope this request needs.",
"doc_url": "https://docs.semalink.africa/errors#scope_missing",
"request_id": "req_5f1d0c2e8a9b4c3d9e7f6a5b4c3d2e1f"
}
}1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9