Erros de API

Quando uma API da Vonage retorna um erro — por exemplo, se sua conta não tiver crédito —, a API retornará um erro no formato RFC 7807.

Isso fornece uma explicação básica sobre qual é o problema, por que ele ocorreu e quais são as etapas para resolvê-lo. Confira o exemplo para ver como um relatório de resolução de problema ( out-of-credit ) é formatado.

Provavelmente, você vai querer avaliar desde o início quais erros seu aplicativo precisará tratar; esta página fornece uma lista de todos os erros possíveis que podem ocorrer, com uma explicação mais detalhada de como lidar com eles.

HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
Content-Language: en
{
  "type": "https://example.com/Error#out-of-credit",
  "title": "You do not have enough credit",
  "detail": "Your current balance is 30, but that costs 50.",
  "instance": "<trace_id>"
}

Configuração do WhatsApp

CódigoInformações
number-in-use

Descrição

Cannot use number because it's already in use by another deployment.

Resolução

Use the existing deployment.

invalid-json

Descrição

The request body did not contain valid JSON

Resolução

Send a JSON request body, including a Content-Type header of application/json

unprocessable

Descrição

Parameters were valid JSON but something was missing or wrongly formatted

Resolução

Fix the incorrect request parameters and try again

unprocessable-profile-update

Descrição

Parameters were valid JSON but something was missing or wrongly formatted

Resolução

Fix the incorrect request parameters and try again

throttled

Descrição

Too many requests have been made on this endpoint

Resolução

Wait a moment and try again

verification-failed

Descrição

Verification step failed. Either because the provided code was incorrect or because too many attempts have been made

Resolução

Try again with the correct OTP, or call resend-otp

conflict-deployment-state

Descrição

Deployment could not be modified because it is currently in a transitional state.

Resolução

If the deployment is transitioning into the state you want it in no action is required. If the state is DELETING, no action is required as the deployment will be deleted. Otherwise, wait for the transition to complete and try again.

conflict-resend-otp

Descrição

Could not resend OTP because the current state of the deployment did not allow it

Resolução

The deployment has either already finished, or is in an error state (in which case you should delete it and run it again).