Onlinesim API

1.1

General description

This API will allow you to access all services provided by Onlinesim:

  • SMS receiving from a single specific service on a virtual number;
  • rent a number to receive SMS from multiple different senders (apps/websites/mobile numbers);
  • you can also use our free numbers to test the service before the purchase.

This API is available for registered Onlinesim users only!

You need to have Onlinesim profile to be able to access this API. Several methods of authentication are available (Authentication), but we will use API key authentication in this documentation for reasons of simplicity.

Receiving messages from payment services, banks, and other financial institutions is not available on our platform. For more detailed information, including a list of such services, please refer to the Public Offer.

List of API requests

Requests are specific for each service provided by Onlinesim and allocated in corresponding sections:

Profile section

These requests are related to the profile or all the services provided by Onlinesim:

  • getBalance - returns the current available balance of your profile, the frozen balance (the funds reserved for active operations, which will be returned if those operations are cancelled), and information about your referral program income.
  • webhook - allows you to set a URI to which all the messages from your active operations will be forwarded to. This includes messages from both single-service and long term rental.

Single-service activations section

Allows you to order a number to receive an unlimited number of SMS from a single service within a short time window (15 minutes for most of the services). Please note that you cannot change the service during the operation. To receive SMS from different services, you will need to order new numbers with the appropriate parameters.

  • getTariffs - returns a quantity of available numbers for each service and country (if specified);
  • getNum - orders a number for a particular service, allowing to receive SMS messages from it;
  • getState - returns detailed information on all active numbers of the profile (including received messages);
  • setOperationRevise - requests next received by the specified number SMS from the queue, if first one didn't have the right code and/or expected information;
  • setOperationOk - sets operation status as successful and closes the operation.

Rent section

This service implies that the number will be used to receive SMS from multiple different senders (including SMS from other mobile numbers), except for those that are prohibited.

  • tariffsRent - returns a list of countries with detailed information on rental plans;
  • getRentNum - orders a number of a chosen country for rent for a certain period;
  • getRentState - returns a list of numbers of your profile with current active rent and received messages;
  • extendRentState - extends the rent of a given number;
  • closeRentNum - closes the rental number.

Free numbers

This API allows you to access the functions to use free Onlinesim numbers available on the home page of our website.

You can use these numbers for testing, but please note that the quantity of available numbers as well as list of available countries are limited. It is also worth noting that messages received on free numbers are not private — they are displayed in the corresponding widget on the main page and are accessible to other users of the site.

There is one general request that allows you to access free numbers:

  • getFreeList - returns detailed information on available list of countries, free numbers and messages they've received.

Postman collection available here:

Run In Postman

Postman documentation

Each request has its own description, type, endpoint's URL, parameters, request and response schemas. Some responses can have examples of specific errors that might appear. Responses are represented in JSON or TXT format based on method called and results.

Common exceptions

Result Description
ACCOUNT_BLOCKED Account has been banned
ERROR_WRONG_KEY API key is invalid or incorrect
ERROR_NO_KEY API key is missing
ERROR_NO_SERVICE Service name is invalid or missing
REQUEST_NOT_FOUND Method called is invalid or missing
API_ACCESS_DISABLED API disabled
API_ACCESS_IP Access from this IP-address is disabled in the profile
WARNING_LOW_BALANCE Not enough funds to buy the service

Servers