Responses

For successful requests, the HTTP status code returned is 200. For failed requests, the HTTP status code returned is not 200, but 4xx or 5xx.

  • 4xx: the parameters are illegal or the operation is not allowed.

  • 5xx: the system error.

Note

Many Zenlayer Cloud APIs are asynchronous APIs. A successful request doesn't mean that the operation is completed and successful.

Response for Successful Requests

For example, when calling bare metal API to create instances (CreateInstances), if the request has succeeded, you may see the response as shown below:

{
    "requestId": "T67723B59-F4D1-42EA-BDC1-5E67167FD8CC",
    "response": {
       "requestId": "T67723B59-F4D1-42EA-BDC1-5E67167FD8CC",
       "instanceIdSet" : ["1234567654321"],
       "orderNumber": "1234567654321"
    }
}
  • requestId: the unique ID of an API request. Contact us with this ID when an exception occurs.

  • response: as long as the API processes the request, it returns Response. does not matter if the request is successful or not. Except for the fixed fields, all fields are action-specified. For the definitions of action-specified fields, see the corresponding API documentation.

Response for Failed Requests

If the request has failed, you may see the response as shown below:

{
    "requestId": "T67723B59-F4D1-42EA-BDC1-5E67167FD8CC",
    "code": "INVALID_ZONE_NOT_FOUND",
    "message": "The specified zoneId `SEL--A` is not found"
}
  • requestId: the unique ID of an API request. Contact us with this ID when an exception occurs.

  • code: the code of the error that helps you identify the cause and solution. You may find the code in either common error codes or API-specified error codes.

  • message: the cause of the error. Note that the returned messages are subject to service updates. The information the messages provide may not be up-to-date and should not be the only source of reference.

Last updated