General


Example of requests

Specially for you, we have prepared several examples for postman

Run in Postman

docs in postmen

We also prepared packages for working with our api

PHP | JS | Python | Ruby | GO

General description

https://onlinesim.io API provides you with the possibility to use our service in the automatic mode. For that purpose, you have to get an APIKEY in the User Profile tab or token OAUTH(read more on the page Authorization) and to implement approximately the following operating procedure in the software:

  1. Request a virtual number, get the TZID (unique number of registered operation) - the getNum method;
  2. Get a mobile number by the TZID, enter the number into the confirmation form on the required website (service) – the getState method;
  3. Run the cycle that will check for receipt of a response - the getState method;
  4. If the response is correct — complete the operation – the setOperationOk method;
  5. If the response does not match — request elaboration – the setOperationRevise method;
  6. Complete the operation – the setOperationOk method;

In order to use the API, you have to perform a POST or GET request via the HTTP protocol to the specified URL: https://onlinesim.io/api/{METHOD_NAME}.php?PARAMETERS&apikey=YOUR_APIKEY&lang=LANGUAGE

Method Description
METHOD_NAME name of the method from the list of API functions
PARAMETERS parameters of the relevant API method
YOUR_APIKEY access key set up in the User Profile tab.
LANGUAGE language, not required parameter. fr - French, de - German, en - English, ru - Russian, zh - Chinese (Simplified)

Common returned responses

The RESPONSE parameter values are common for all methods.

json {response: RESPONSE, …, … }

Result Description
ACCOUNT_BLOCKED account blocked
ERROR_WRONG_KEY wrong apikey
ERROR_NO_KEY no apikey
ERROR_NO_SERVICE service not specified
REQUEST_NOT_FOUND API method not specified
API_ACCESS_DISABLED api disabled
API_ACCESS_IP access from this ip is disabled in the profile
WARNING_LOW_BALANCE Not enough funds to buy the service