Skip to content

GetStateInstance#

The method is aimed for getting the account state.

Request#

To get the account state, you have to execute a request at:

GET https://api.green-api.com/waInstance{{idInstance}}/getStateInstance/{{apiTokenInstance}}

For idInstance and apiTokenInstance request parameters, refer to section Before you start.

Response#

Response parameters#

Parameter Type Description
stateInstance string Account state. Have variants:
notAuthorized - Account is not authorized. For account authorization refer to Before you start section
authorized - Account is authorized
blocked - Account banned
sleepMode - Account is in sleep mode. The state is possible when the phone is switched off. After the phone is switched on, it may take up to 5 minutes for the account state to be changed to authorized.
starting - The account is in the process of starting up (service mode). An instance, server, or instance in maintenance mode is rebooting. It may take up to 5 minutes for the account state to be set to authorized.

Response body example#

{
    "stateInstance": "authorized"
}

Errors GetStateInstance#

For a list of errors common to all methods, refer to Common errors section

Python request example#

import requests

url = "https://api.green-api.com/waInstance{{idInstance}}/getStateInstance/{{apiTokenInstance}}"

payload = {}
headers= {}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))