Authorization
Authorization
General Information
Requests are authenticated with an API key: a secret key that identifies your partner account.
- v1 Reseller API — our server calls your server and puts the key into the
keyfield of every request body. - v2 Reseller API — your server calls our partner server. Use the API key of your partner account on that server (partner support gives you the server URL and the key). The API key of your onlinesim.io customer profile does not work here.
How to pass the key in v2
Any one of these works; the first one found is used:
apikeyheader:apikey: {apikey}apikeyparameter in the query string (or in the request body):?apikey={apikey}Authorizationheader (recommended):Authorization: Bearer {apikey}. TheBearerprefix is optional.
Authorization: Bearer {apikey}
Content-Type: application/jsonA query-string key ends up in access logs, so prefer a header.
Errors
- No key, or a key that does not exist: HTTP 401 with the plain-text body
Unauthorized.If the request hasAccept: application/json, the same error comes as HTTP 200 with the body{"response":"ERROR_WRONG_KEY"}, so always checkresponsein the body. - The key is valid but the account may not use the API: HTTP 403 with
ERROR_DISABLED(the partner account is not activated),ERROR_BANNED(the account is blocked) orERROR_IP(the request comes from an IP address that is not in the account's allowlist).
| Property | Value |
|---|---|
| Type | apiKey |
| In | header |
| Name | Authorization |