UpdateApiToken#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method is intended for getting a new instance token.
Request#
To get a new instance token, you need to execute a request at:
GET
{{apiUrl}}/waInstance{{idInstance}}/updateApiToken/{{apiTokenInstance}}
To get the apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
apiTokenInstance | string | Instance token |
Response body example#
{
"apiTokenInstance": "d4e4276df8044c259611ee08aefc198482b441126d517a466d"
}
In case of failure, a response with HTTP status 200 is returned; the response body contains a JSON string with the error code and description:
{
"code": 401,
"description": "Unauthorized"
}
UpdateApiToken errors#
For the list of errors common to all methods, see the Common errors section
Code examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/updateApiToken/{{apiTokenInstance}}"
payload={}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
curl --location -g --request GET '{{apiUrl}}/waInstance{{idInstance}}/updateApiToken/{{apiTokenInstance}}'