Skip to main content

Util::SMS - receiving codes from SMS

Overview of the parser

This parser is used only as a pluggable component in other parsers where SMS code verification may be required, such as SE::Yandex::RegisterSE::Yandex::Register, as well as in custom JavaScript parsers. Virtual number providers are used to order numbers and receive SMS codes.

The principle of this parser'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 parser

Use cases

  • Receiving codes from SMS in built-in parsers where it is necessary to pass verification by entering a code from SMS
  • Receiving codes from SMS in custom JS parsers

Queries

note

When calling from JS parsers, it is recommended to enable skipProxySettingsInheritance

There are 3 types of queries that this parser 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 id, you need to specify the order ID received in getNumber (in the example above, it is 123456). As a result, the order ID $id, the phone number $number (may be empty for some providers), and the code from SMS $code will be returned

Closing an order

{"action":"closeNumber","id":123456}

In id, you need to specify the order ID received in getNumber (in the example above, it is 123456)

General algorithm of operation

  • 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
  • Upon successful receipt of the code, use it where required
  • Close the order (closeNumber)

Possible settings

ParameterDefault valueDescription
Provideronlinesim.ioSelection of the virtual number provider
API key for providerAPI access key for the selected provider
ServiceCustom serviceThe 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 in the form of a JSON object and contain only those parameters that need to be overridden. The full list of parameters should be found in the documentation of the selected provider.
Wait time for receiving SMS120Waiting time for the SMS code