Reseller API
v1.0General description
The API is intended for current and potential Onlinesim partners. It allows you to monetize your numbers by providing them to our customers for receiving SMS from various services and applications.
Currently, two versions of the API are implemented:
- v1 is suitable for partners who already have their own logic for working with numbers. In this scheme, our server contacts yours for information about available numbers and, if a suitable number is found, requests it to receive SMS.
- v2 has a reverse scheme: the main logic of operations is on our side. You periodically send us a list of your numbers and forward incoming SMS to them, while the numbers are immediately available for order by customers.
v1 API
Our server sends every request as an HTTP POST with a JSON body (UTF-8) to the URL you give us; the method name is in the action field and your partner key in the key field. Your answer is read from its JSON body; its HTTP status is not used.
Requirements for v1:
- Answers are JSON in UTF-8
- The names of countries and services used in the response of GET_SERVICES must match the corresponding lists of countries and services
- One number should only be used for one operation at a time: your server can issue this same number for another service only after the previous operation is completed
- Webhook PUSH_SMS: your server must automatically forward SMS received by numbers with active operations to the Onlinesim server
- Filtering can be performed either on our side or on yours. Before integration, inform us which option is preferable for you
- Answer GET_NUMBER quickly: the request has a timeout (10 seconds by default, depending on the integration), after which the order goes to another partner
Checklist for integration:
-
It is necessary to implement 3 methods and a webhook:
GET_SERVICES - requests the number of numbers by country and service from your server
GET_NUMBER - reserves a number for a short period (by default 15 minutes) with specified parameters for receiving SMS from a specific service for a specified amount
PUSH_SMS (webhook) - when an SMS is received by a reserved number, your server sends it to our server
FINISH_ACTIVATION - closes the operation with specific parameters (depending on the result)
- Contact us via email or Telegram to create a partner profile, provide the URL for requests from our side, obtain a link for the webhook, and test the numbers.
- After successful tests, your numbers will be available to our customers within a few hours.
v2 API
Reseller API v2 allows you to integrate your equipment and numbers for their subsequent use by customers for receiving SMS through our website. We have tried to make it as simple as possible for integration. To get started, you need to:
- Implement 2 methods:
-
sendNumbersOnline - sends a list of your numbers to our server, this request should be sent every 5 minutes to update the list of numbers and as confirmation of your server's uptime;
-
forwarding incoming SMS to our server — addMessage (one message at a time) or addMessages (in batches).
- Contact support to obtain
_SERVER_URL_ - The remaining requests are optional, implementing them is not mandatory, but their description is available in the documentation.
- The
/api/resellersrequests accept an optional parametertestfor trying the integration, in the query string or in the body: withtest1the request runs and answers as usual but its database changes are rolled back; withtest2it is not executed and the answer is a dump of the request as our server received it. A request withtestdoes not confirm your server's uptime.
After you receive a response indicating that the sendNumbersOnline request was successfully executed, contact partner support to check if our server is receiving messages using the addMessage or addMessages requests. If successful, your numbers will be available to our customers within a few hours.
Appendix
Workflow
Terms of service:https://onlinesim.io/documentation/offer
Contact
License
Servers
{yourserver}
Your server URL
Variables:
| Name | Default | Enum | Description |
|---|---|---|---|
yourserver | https://{yourserver.com} | - |