​Отмена сеанса аутентификации

Используется для отмены процесса аутентификации. В этом случае аутентификация должна находиться в статусе "ожидание".

Чтобы отменить сеанс аутентификации, отправьте запрос по этому URL:
POST https://one-api.notificore.ru/api/2fa/authentications/{id}/cancel



Request parameters

Parameter Requires Type Default Description
id Yes string No Authentication ID received in response to https://one-api.notificore.ru/api/2fa/authentications/otp. The maximum length is 36 characters.


Response parameters

Parameter Type Description
id string The ID of the generated authentication.
recipient string Number of the recipient of the message with the OTP code.
status string Authentication status. Possible values: canceled.
channel string Channel for authentication.
sender string Sender’s name.
sender_alt string Alternate SMS sender name
message_text string Message text.
code_lifetime integer OTP expiration date.
code_max_tries integer The number of OTP check attempts.
code_digits integer The number of digits in the OTP.
price float Authentication session cost. If authentication is canceled, the cost will be 0.
currency string The three-letter code of the currency in which the cost is indicated.
country_code string Receiver’s country code according to ISO 3166-1 alpha-2.
expired_at string Date and time when the authentication session expires in ISO 8601 format.
created_at string The date and time of the authentication session was created in ISO 8601 format.
finished_at string Date and time when the authentication session was closed in ISO 8601 format.


Response example

Ответ в случае успешного запроса:

{
  "data": {
    "id": "bf4381c8-9d4a-4705-bd28-f89a830b7f96",
    "recipient": "792979965073",
    "status": "canceled",
    "channel": "sms",
    "sender": "SENDER",
    "sender_alt": "SENDER_ALT",
    "message_text": "Your verification code: {code}",
    "code_lifetime": 300,
    "code_max_tries": 3,
    "code_digits": 5,
    "price": "0,02",
    "currency": "USD",
    "country_code": "RU",
    "expired_at": "2023-01-04 18:37:06",
    "created_at": "2023-01-04 17:37:06",
    "finished_at": "2023-01-04 17:37:06"
  }
}


Possible errors

Code Error Description
404 Authentication not found This error can occur when the authentication identifier is specified incorrectly or the specified authentication is not present in the system. Please ensure that you are using the correct authentication identifier and try again.
422 Authentication failed status This error can occur when attempting to cancel an authentication session that is already completed with a “failed” status. It is only possible to cancel an authentication session while it is in the “pending” status.
422 Authentication expired This error can occur when attempting to cancel an authentication session that is already completed with an “expired” status. It is only possible to cancel an authentication session while it is in the “pending” status.