Util::SMS - receiving codes from SMS
Overview of the scraper
This scraper is used only as a connectable component in other scrapers where it may be necessary to pass verification in the form of entering a code from an SMS, for example
SE::Yandex::Register, as well as in custom JavaScript scrapers. Virtual number providers are used to order numbers and receive codes from SMS.
The principle of operation of this scraper is to request a phone number and receive the code from an SMS. Receiving the SMS and returning the correct code depends solely on the virtual number provider.
Capabilities
- Supports working with the following virtual number providers: 5sim.biz, onlinesim.io, sms-activate.io
- Ability to configure the code waiting time
- Ability to specify a custom config for API requests, which will be used over the values set in the scraper
Use cases
- Getting codes from SMS in built-in scrapers that require verification through entering an SMS code
- Getting codes from SMS in your own JS scrapers
Queries
When calling from JS scrapers, it is recommended to enable skipProxySettingsInheritance
There are 3 types of requests that this scraper accepts as input. Details on each are below.
Ordering a number
{"action":"getNumber"}
This will return the order ID $id and the phone number $number
Getting the code from SMS
{"action":"getCode","id":123456}
In id, you must specify the order ID received in getNumber (123456 in the example above). This will return the order ID $id, phone number $number ((may be empty for some providers) and the code from SMS $code
Closing the order
{"action":"closeNumber","id":123456}
In id, you must specify the order ID received in getNumber (123456 in the example above)
General work algorithm
- Request a new number (
getNumber) - Specify the received number where required
- Request the code from SMS (
getCode), using the order ID received in the response to getNumber - If the code is successfully received, use it where required
- Close the order (
closeNumber)
Possible settings
| Parameter | Default value | Description |
|---|---|---|
| Provider | onlinesim.io | Selection of the virtual number provider |
| API key for provider | API access key for the selected provider | |
| Service | Custom service | The service that will send the SMS; for Custom service, the service must be specified in Custom config for API request according to the documentation of the selected provider |
| Custom config for API request | {} | Custom config for API requests. Must be a JSON object and contain only the parameters that need to be overridden. The full list of parameters should be sought in the documentation of the selected provider. |
| Wait time for receiving SMS | 120 | Waiting time for the code from SMS |