SendAuthorizationPassword#
The method is intended for completing the instance authorization process using the QR method, if a password is set on the Telegram account.
The method uses limits on the request rate per second.
Request#
To send the instance authorization code, you need to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/sendAuthorizationPassword/{{apiTokenInstance}}
To get the apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
password | string | No | Two-factor authentication password (Cloud Password) set on the account |
Request body example#
Request body example:
{
"password": "qwerty"
}
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
status | boolean | Status of the sent password |
true - The request executed successfully | ||
false - The request executed with an error | ||
data | object | Details of the sent password |
Fields of the data object#
| Field | Type | Description |
|---|---|---|
status | string | Result of the authorization: |
success - Authorization completed successfully | ||
fail - Authorization failed | ||
reason | string | Reasons in case of fail: |
already_registered — the instance is already authorized | ||
invalid_password — an incorrect password was specified | ||
rate_limit_exceeded — too many attempts, try again later | ||
authorization_not_started — the startAuthorization method was not called | ||
timeout — the waiting time for a response from Telegram servers has expired |
Response body example#
Successful execution of the method:
{
"status": true,
"data": {
"status": "success",
"reason": ""
}
}
The attempt limit has been exceeded:
{
"status": false,
"data": {
"status": "fail",
"reason": "rate_limit_exceeded"
}
}
Errors#
For the list of errors common to all methods, see the Common errors section