gethttps://onlinesim.io/api/getNum.php

GET /api/getNum.php

Buy a virtual number for a selected service

Requests a phone number for a particular service, allowing to receive SMS messages from it.

Allows you to order a number of a specified country to receive SMS from the website/app that you want.

This request in fact plays the same role as the "Buy number" button located on the user dashboard.

Security

OAuth2Scopes: sms-scope
sms-scope
grants access to manage numbers for the SMS receiving service from Onlinesim

Parameters

query6
NameTypeDescription
service*string

Service name (can only accept values of services from getTariffs)

Example:facebook
countryinteger
≥ 1

'International dialing code of the country (Е.164 standard, without "+" sign), see country list in getTariffs'

Default:7Example:46
rejectstring[]

Array for mask exception (including country code) Example: when 911, 912123 is passed, the server won't issue numbers of India, that starts with +911* and +912123*.

Example:["911"]
dev_idinteger

Account ID for software developers (Onlinesim profile's ID).

Example:100000
numberboolean

'Display number in response. If true, the phone number will be displayed in the response.'

Example:false
langstring

Response language: fr - French, de - German, ru - Russian, en - English, zh - Chinese. Please note that the translation applies only to string field values, such as service names or country names. Field names themselves, error messages, and standard values (for example, true/false for boolean fields) remain in English.

Enum:frderuenzhDefault:ruExample:en

Responses

200

Successful response for getNum request: the server issues a dedicated virtual number for specified service or throws an exception.

Content-Typeapplication/json
Schema
Responseobject
responseoneOf

1, if the request has been completed successfully, or an error message

Example:1
One Of
[0]integer
[1]string
tzidinteger

Operation ID

≥ 1
Example:10000

Examples

Successful getNum response example
{
  "response": 1,
  "tzid": 10000
}

Code Samples

Generating examples...