General endpoints¶
Test¶
/testUsed to test if the interface/API is available.
Request¶
Auth: None
Request body:
None
Request example:
https://spoilerinterface.com/interface/test
Response¶
Field description¶
| Field name | Description | Type |
|---|---|---|
| message | Spoiler test message | str |
| time | Server time when the request was handled (epoch seconds) | int |
Version¶
/versionUsed to get the API version.
Request¶
Auth: None
Request body:
None
Request example:
https://spoilerinterface.com/interface/version
Response¶
Field description¶
| Field name | Description | Type |
|---|---|---|
| version | API version | str |
| release_date | Release date of the version | str |
Countries¶
/info/countriesUsed to get the list of countries with their dialling codes and ISO codes.
Request¶
Auth: None
Request body:
None
Request example:
https://spoilerinterface.com/interface/info/countries
Response¶
{
"success": [
{ "name": "Afghanistan", "code": "+93", "iso": "AF" },
{ "name": "Albania", "code": "+355", "iso": "AL" }
]
}
Field description¶
| Field name | Description | Type |
|---|---|---|
| name | Country name | str |
| code | Dialling code, e.g. +27 |
str |
| iso | ISO 3166-1 alpha-2 country code | str |
Packages¶
/packagesUsed to get the available account types and their limits.
Request¶
Auth: api_key
Request body:
None
Request example:
https://spoilerinterface.com/interface/packages?api_key=a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
Response¶
The list contains five packages (account types 1 to 5); two are shown.
{
"success": [
{
"account_type": "1",
"name": "Basic (Free)",
"retention_time_days": 35,
"api_calls": 200000,
"max_devices": 5,
"update_period_sec": 60,
"monthly_cost_zar": 0,
"per_call_price": 0.015
},
{
"account_type": "2",
"name": "Start-up",
"retention_time_days": 65,
"api_calls": 1000000,
"max_devices": 20,
"update_period_sec": 30,
"monthly_cost_zar": 30,
"per_call_price": 0.013
}
]
}
Field description¶
| Field name | Description | Type |
|---|---|---|
| account_type | Account type number: 1 Basic (Free), 2 Start-up, 3 Growth, 4 Premium, 5 Enterprise |
str |
| name | Package name | str |
| retention_time_days | How long history is kept | int |
| api_calls | API calls included | int |
| max_devices | Maximum number of devices | int |
| update_period_sec | Advertised minimum time between device updates | int |
| monthly_cost_zar | Monthly cost in ZAR (Premium has annual_cost_zar instead; Enterprise returns it as a string) |
int |
| per_call_price | Price per API call | float |
Bundles¶
/bundlesUsed to get the WhatsApp and SMS message bundles that can be bought.
Request¶
Auth: None
Request body:
None
Request example:
https://spoilerinterface.com/interface/bundles
Response¶
amount_zar is converted from amount_usd at the current exchange rate. Two WhatsApp bundles are shown; the response contains four of each kind.
{
"success": {
"merchant_id": "<merchant_id>",
"merchant_key": "<merchant_key>",
"whatsapp_products": [
{
"item_name": "whatsapp_essential_bundle",
"whatsapp_messages": 769,
"amount_zar": 91.5,
"amount_usd": 5
},
{
"item_name": "whatsapp_team_bundle",
"whatsapp_messages": 1538,
"amount_zar": 183.0,
"amount_usd": 10
}
],
"sms_products": [
{ "item_name": "SMS: Essential bundle", "amount": 3900 },
{ "item_name": "SMS: Team bundle", "amount": 3900 },
{ "item_name": "SMS: Corporate bundle", "amount": 3900 },
{ "item_name": "SMS: Enterprise bundle", "amount": 3900 }
]
}
}
Field description¶
| Field name | Description | Type |
|---|---|---|
| merchant_id | Payment gateway merchant id used by the dashboard checkout | str |
| merchant_key | Payment gateway merchant key used by the dashboard checkout | str |
| whatsapp_products | WhatsApp bundles: whatsapp_essential_bundle (USD 5), whatsapp_team_bundle (USD 10), whatsapp_corporate_bundle (USD 20), whatsapp_enterprise_bundle (USD 50) |
arr |
| whatsapp_messages | Number of WhatsApp messages in the bundle | int |
| amount_zar | Price in ZAR | float |
| amount_usd | Price in USD | int |
| sms_products | SMS bundles | arr |
| amount | SMS bundle amount | int |