Error Response

A request is successfully accepted with an HTTP status code of 2xx. Otherwise, it indicates that something goes wrong with an HTTP status code of 4xx or 5xx. Codes in the 5xx range indicate an error with YCloud's servers, while codes in the 4xx range indicate an error caused by clients.
A structured response body is returned when errors occur, here is an example of response body for errors:

{
  "error": {
    "status": 400,
    "code": "PARAM_INVALID",
    "message": "Parameter 'page' should be between 1 and 100.",
    "target": "page",
    "docUrl": "https://example.com/errors#param_invalid"
}

Error Object

status

REQUIRED. The HTTP status code generated by the origin server for this occurrence of the problem. it conveys the HTTP status code used for the convenience of the consumer.

code

REQUIRED. One of a server-defined set of error codes, which could be handled programmatically.

message

A human-readable representation of the error. It is intended as an aid to developers and is not suitable for exposure to end users.

target

The target of the error. It could be the parameter field when a parameter is invalid.

docUrl

A URL to more information about the error.

Error Codes

Below is a list of possible error codes, along with additional information about how to resolve them.

ACCOUNT_LIMITED

The account is limited due to some reason. For example, trial accounts can only send messages to pre-verified phone numbers, this error code returns when trial accounts try to send to other phone numbers.

ACCOUNT_UNAVAILABLE

The account is unavailable. Contact our customer service for more help.

ALREADY_EXISTS

A resource already exists. Please check your owned resources and your request parameters.

BAD_REQUEST

Bad Request. Something goes wrong with the request parameters.

BALANCE_INSUFFICIENT

The account balance is insufficient. Please top-up.

CONTENT_PROHIBITED

The content is prohibited according to our terms.

CONTENT_TOO_LARGE

The content is too large. Please reduce the request body.

EMAIL_DOMAIN_UNVERIFIED

The email domain is unverified. It may take some minutes to verify the email domain, please wait.

FORBIDDEN

Usually occurs when you try to access a resource that you don't own.

INTERNAL_SERVER_ERROR

Something goes wrong with our servers. These are rare.

NOT_FOUND

A resource doesn't exist.

PARAM_INVALID

One or more of the parameters is invalid.

PARAM_INVALID_LENGTH

The parameter's length is out of range.

PARAM_MISSING

One or more of the parameters is missing.

PARAM_NOT_MATCH

One parameter does not match with another one.

TOO_MANY_REQUESTS

Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.