Util::SMS - receiving codes from SMS
Overview of the scraper
This scraper is used only as a plug-in component in other scrapers where it may be necessary to pass verification by entering a code from SMS, for example
SE::Yandex::Register, as well as in custom JavaScript scrapers. Virtual number providers are used to order numbers and receive SMS codes.
The principle of this scraper's operation consists of requesting a phone number and receiving a code from SMS. Receiving the SMS and returning the correct code depends solely on the virtual number provider.
Capabilities
- Support for 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 on top of the values set in the scraper
Use Cases
- Receiving codes from SMS in built-in scrapers that require verification via SMS code entry
- Receiving codes from SMS in custom JS scrapers
Queries
When calling from JS scrapers, it is recommended to enable skipProxySettingsInheritance
There are 3 types of queries that this scraper accepts. More details on each below.
Ordering a number
{"action":"getNumber"}
As a result, the order ID $id and the phone number $number will be returned.
Receiving a code from SMS
{"action":"getCode","id":123456}
In the id field, specify the order ID received in getNumber (in the example above, it is 123456). As a result, the order ID $id, phone number $number (may be empty for some providers), and the SMS code $code will be returned.
Closing an order
{"action":"closeNumber","id":123456}
In the id field, specify the order ID received in getNumber (in the example above, it is 123456).
General workflow algorithm
- Request a new number (
getNumber) - Provide the received number where required
- Request the SMS code (
getCode) using the order ID received in the getNumber response - Upon successful receipt of the code, 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 selected provider's documentation |
| 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 found in the selected provider's documentation. |
| Wait time for receiving SMS | 120 | Waiting time for the SMS code |