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

GET /api/getState.php

Get information on numbers with active operations

Returns detailed information on all active numbers you have (or specific one).

It allows you to check the status of operations of your account and read the messages received on ordered numbers.

For example, you can use this request to get a list of all SMS from active numbers to process them.

In fact, this is a representation of active operations section ("My numbers") from the user dashboard.

Active operations

Security

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

Parameters

query6
NameTypeDescription
tzidinteger
≥ 1

Operation ID

Example:10000
message_to_codeinteger

'SMS display mode:

0 - show the entire SMS,

1 - display only the code from the SMS'

Enum:01Example:1
orderbystring

'Sorting order:

asc - ascending;

desc - descending'

Enum:ascdescDefault:ascExample:asc
msg_listinteger
≥ 0, ≤ 1

'Message list display mode:

0 - show only the active message,

1 - show the whole list'

Enum:01Example:1
cleaninteger
≥ 0, ≤ 1

'Message display mode (only for msg_list = 0):

0 - show previosly shown messages,

1 - do not show previously shown messages'

Enum:01Example:1
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 getState request: the server returns detailed information on active numbers of your account or throws an exception.'

Content-Typeapplication/json
Schema
Responseobject[]

Array of active numbers (current operations) on your account

itemsobject

Operation information

countryinteger

International dialing code of the country (Е.164 standard, without "+" sign)

≥ 1
Default:7Example:46
suminteger

Price for current service (in RUB)

≥ 0
Example:14
servicestring

'Service name, with the same values as in the getNum method'

Example:Facebook
numberstring

Phone number in international format

Example:+46050101010
responsestring

'Current status of the operation (enum):

TZ_INPOOL - waiting for a number to be dedicated to the operation

TZ_NUM_WAIT - waiting for SMS

TZ_NUM_ANSWER - SMS has been received

TZ_OVER_EMPTY - SMS was not received during the operation period

TZ_OVER_OK - operation has been successfully completed

ERROR_NO_TZID - tzid (operation ID) is not specified

ERROR_NO_OPERATIONS - no active operations'

Enum:TZ_INPOOLTZ_NUM_WAITTZ_NUM_ANSWERTZ_OVER_OKERROR_NO_TZIDERROR_NO_OPERATIONSExample:TZ_NUM_ANSWER
tzidinteger

Operation ID

≥ 1
Example:10000
timeinteger

Time remaining for current operation, in seconds

≥ 0
Example:281
formstring

Type of service (single-service activations — index)

Example:index

Examples

Successful getState response example
[
  {
    "country": 7,
    "sum": 14,
    "service": "Facebook",
    "number": "+46050101010",
    "response": "TZ_INPOOL",
    "tzid": 10000,
    "time": 281,
    "form": "index"
  }
]

Code Samples

Generating examples...