GetInstances#
The method is aimed for getting all the account instances created by the partner.
Request#
To get all the account instances you have to execute a GET request at:
{{partnerApiUrl}}/partner/getInstances/{{partnerToken}}
For
partnerApiUrl
request parameter, you can find it in your console.For
partnerToken
request parameter please contact Green API support@green-api.com with a request to get a partnership API-token.
Response#
Response parameters#
Parameter | Type | Description |
---|---|---|
idInstance | integer | Instance Id. The size of the integer is int64. Values range include from 1 to 10 digits |
name | string | The name of the instance specified by the user in the console or by the method createInstance |
typeInstance | string | Messenger type for account instance |
typeAccount | string | Deprecated |
partnerUserUiid | string | Deprecated |
timeCreated | string | Instance creation time |
timeDeleted | string | Instance deletion time |
apiTokenInstance | string | Account instance API token |
deleted | boolean | Instance status, shows instance deleted or active, true/false |
tariff | string | Connected plan on the instance |
isFree | boolean | Flag indicates a free instance, for example, an instance of the "Developer" plan. It takes the values true/false. |
isPartner | boolean | Flag indicates whether the instance belongs to the "Partner" plan. It takes the values true/false. |
expirationDate | string | Instance expiration date (Partner instances auto-renew) |
isExpired | boolean | Instance state, shows whether the instance has expired or not, takes the values true/false |
Note
The GetInstances method returns all instances for the lifetime of the account (deleted instances are shown for the last 3 months).
Instance creation and deletion definitions are determined by the fields in the response.
Response body example#
If successful, in response to the request, you get a JSON string with HTTP 200 status of the below form:
[
{
"idInstance": 1101728004,
"name": "Instance 1101728004",
"typeInstance": "whatsapp",
"typeAccount": "",
"partnerUserUiid": "",
"timeCreated": "2022-06-03T18:39:44",
"timeDeleted": "0001-01-01T00:00:00",
"apiTokenInstance": "1f2485e80f474293b935f77d78c64e76fa4bdceb417a4998a4",
"deleted": false,
"tariff": "PARTNER_23",
"isFree": false,
"isPartner": true,
"expirationDate": "2022-06-09T18:39:44",
"isExpired": false
},
{
"idInstance": 1101728204,
"name": "Instance 1101728204",
"typeInstance": "whatsapp",
"typeAccount": "",
"partnerUserUiid": "",
"timeCreated": "2022-06-07T10:36:48",
"timeDeleted": "2022-06-07T10:37:00",
"apiTokenInstance": "35d8b4907f8e494289b1d5f999e3582940ceffc413bf4a76b1",
"deleted": true,
"tariff": "PARTNER_23",
"isFree": false,
"isPartner": true,
"expirationDate": "2022-06-08T10:36:48",
"isExpired": false
},
{
"idInstance": 1101728478,
"name": "Instance 1101728478",
"typeInstance": "whatsapp",
"typeAccount": "",
"partnerUserUiid": "",
"timeCreated": "2022-06-08T09:12:13",
"timeDeleted": "2022-06-08T09:19:04",
"apiTokenInstance": "c8b0474542154e0ead529eb3861ca5f483c346eb00564f64a7",
"deleted": true,
"tariff": "PARTNER_23",
"isFree": false,
"isPartner": true,
"expirationDate": "2022-06-09T09:12:13",
"isExpired": false
}
]
To get accounts instances parameters, use the corresponing API methods.
In case of entering incorrect token, you get a response with HTTP 200 status, a JSON string with a code and description of the error is returned in the response body:
{
"code": 401,
"description": "Unauthorized"
}
In case of failure, a response with HTTP 400 status and an error text is returned.
GetInstances errors#
For a list of errors common to all methods, refer to Common errors section