single-service activations

Get information on numbers with active operations

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

Returns the operations of your account with their status and received SMS — the "My numbers" section of the dashboard. tzid limits the answer to one operation. POST with the same parameters works too.

  • msg holds the current SMS: the code by default, the full text with message_to_code=0, all SMS with msg_list=1. setOperationRevise moves the current SMS to the next one.
  • Answers are cached for 5 seconds: the same request repeated sooner gets the same answer. Without tzid, a setOperationRevise call can therefore show up only after that time.

Active operations

Security

Parameters

query10
NameTypeDescription
tzidinteger

Operation ID: return only this operation

message_to_codeinteger

1 — only the code from the SMS, 0 — the full text; 2 with msg_list=1 — both (text and code). Values other than 1, true, yes, on and 2 count as 0

Enum:012Default:1
orderbystring

Order of the operations in the list by operation ID: desc — newest first, asc — oldest first. Lowercase only

Enum:ascdescDefault:desc
msg_listinteger

1 — msg is a list of all SMS of the operation, 0 — only the current SMS

Enum:01Default:0
cleaninteger

Only with msg_list=0. With this parameter (any value, even 0) msg is false once setOperationRevise has moved past the last SMS; without it the SMS start over from the first one

lastinteger

Only with msg_list=0. 1 — msg is the newest SMS instead of the current one

Enum:01Default:0
numberboolean

With this parameter (any value, even 0) each operation also has guard_interval_remaining_seconds

with_responseinteger

1 — the list comes as {"response": "1", "list": [...]} instead of a bare array

Enum:01Default:0
textinteger

Only with tzid. 1 — the answer is the msg of that operation alone, as a JSON string; before the first SMS (and for an operation without a number) it is an empty string

Enum:01Default:0
langstring

Language of the texts in the answer (country and service names, status texts): fr, de, ru, en or zh. Every method accepts it; methods without such texts answer the same in any language. Field names, error codes and other fixed values stay in English. Without the parameter: ru for getTariffs, getNumbersStats and getFreeList; otherwise the language of the profile for requests with a key, English for requests without one. An unsupported value falls back to the default language

Enum:frderuenzh

Responses

200Operations or an error
Content-Typeapplication/json
Schema
schemaoneOf
One Of
[0]object[]Operations of the account (never empty: without operations the answer is ERROR_NO_OPERATIONS)
[1]objectWith with_response
[2]string
With tzid and text: the msg of that operation alone
[3]object
[4]object

Examples

success

One operation with an SMS

[
  {
    "country": 373,
    "sum": 0.36,
    "service": "telegram",
    "number": "+37360000000",
    "webhook_url": null,
    "subscription_package_id": null,
    "response": "TZ_NUM_ANSWER",
    "tzid": 10000,
    "time": 596,
    "msg": "123456",
    "form": "index"
  }
]
ERROR_NO_OPERATIONS

No operations

{
  "response": "ERROR_NO_OPERATIONS"
}
429HTTP 429: more than 400 requests per minute from one profile (from one IP for requests without a key), or more than 200 requests per minute from one profile to getNum, getPrice, getState and setOperationOk together
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Rate limit

Request rate limit exceeded

{
  "response": "TRY_AGAIN_LATER"
}
456HTTP 456: the API key is invalid or the OAuth token has expired. Public methods answer the same way when an invalid key is sent
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Invalid key

Invalid API key or expired token

{
  "response": "ERROR_WRONG_KEY"
}

Code Samples

Generating examples...