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 key field 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:

  1. apikey header: apikey: {apikey}
  2. apikey parameter in the query string (or in the request body): ?apikey={apikey}
  3. Authorization header (recommended): Authorization: Bearer {apikey}. The Bearer prefix is optional.
Authorization: Bearer {apikey}
Content-Type: application/json

A 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 has Accept: application/json, the same error comes as HTTP 200 with the body {"response":"ERROR_WRONG_KEY"}, so always check response in 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) or ERROR_IP (the request comes from an IP address that is not in the account's allowlist).
PropertyValue
TypeapiKey
Inheader
NameAuthorization