Status and error codes

Updated

Troubleshoot common Cloud Transcoding REST API issues.

This page lists response status codes for Cloud Transcoding and Multi-bitrate streaming, along with their descriptions and recommended actions.

Cloud Transcoding

When you call the Cloud Transcoding REST API, you receive an HTTP response status code:

  • If the HTTP status code is 2XX, the request is successful.
  • If the HTTP status code is not 2XX, the request failed.

The following example shows a failed request:

// 400 Bad Request
{
  "message": "appid is invalid"
}

When using Cloud Transcoding, you may receive status codes that indicate the service status. Refer to the following table to understand their meanings and take appropriate action.

Status codeDescriptionSuggested action
200 OKThe request was successful.No troubleshooting is required.
201 Created (Deprecated)The task is already in progress. Do not use the same builderToken to start the task again.No troubleshooting is required.
202 AcceptedThe server has received the task request, but the task execution may not be complete.Query the execution status before proceeding to the next business operation.
400 Bad RequestThe request syntax is incorrect, the parameter value does not meet the requirements, or your App ID does not have Cloud Transcoding enabled.Investigate based on the message field in the response body.
401 UnauthorizedThe Authorization field for HTTP Basic authentication is invalid.See RESTful authentication or check your Authorization credentials.
403 ForbiddenCloud Transcoding is not enabled for your App ID.Contact technical support to activate it.
404 Not FoundTranscoder not found.Use a backoff strategy to make a query request and confirm whether the transcoder was created successfully.
409 ConflictA transcoder task with the same instanceId already exists.Delete the existing transcoder before creating a new one.
429 Too Many RequestsThe request rate exceeds the upper limit.Wait for a while and try again.
500 Internal Server ErrorInternal Agora server error.Use a backoff strategy for query requests or contact technical support.
501 Not ImplementedThis method is not implemented.No troubleshooting is required.
503 Service UnavailableThe Agora server is temporarily overloaded or undergoing maintenance.Use a backoff strategy for query requests or contact technical support.
504 Gateway TimeoutAn internal Agora server error occurred, an upstream server did not respond, or the upstream server is shut down.Use a backoff strategy for query requests or contact technical support.

When using the Cloud Transcoding response status code for troubleshooting, keep the following in mind:

  • If the request fails, do not perform logical processing based on the message field in the response body. Rely primarily on the status code for troubleshooting.
  • If the troubleshooting methods in the table do not resolve the issue, contact technical support with the values of the X-Request-ID and X-Resource-ID fields in the response header.
  • If you receive a 404 status code after a Create request has returned successfully and you have not called Delete, or if the transcoder remains idle beyond the idleTimeout value in the request, use a backoff algorithm. Retry at increasing intervals of 5, 10, and 15 seconds to call Query for confirmation.
  • A 5XX response status code usually indicates an issue in the server response process. Use a backoff strategy for query requests, retrying at increasing intervals of 5, 10, and 15 seconds, or contact technical support.

Multi-Bitrate

When you call the Multi-Bitrate REST API, you receive an HTTP response status code:

  • If the HTTP status code is 2XX, the request is successful.
  • If the HTTP status code is not 2XX, the request failed.

The following example shows a failed request:

// 400 Bad Request
{
  "status": "string",
  "data": {},
  "message": "string"
}

When using Cloud Transcoding Multi-Bitrate, you may receive status codes that indicate the service status.

Status codeDescriptionSuggested action
200 OKThe operation was successful.No troubleshooting is required.
400 Bad RequestThe request is invalid.Check whether the request parameters are valid.
401 UnauthorizedThe authentication is invalid.Check whether the Authorization parameters used for HTTP authentication are correct.
404 Not FoundThe requested resource was not found.Check that the appId and codecId parameter values are correct.
415 Unsupported Media TypeUnsupported media type.Ensure that the Content-Type field in the request header is set to application/json.
429 Too Many RequestsRequests are too frequent.Wait for a while and try again.
500 Internal Server ErrorInternal server error.Retry a few times.

If the troubleshooting methods above do not resolve the issue, contact technical support with the X-Request-ID and X-Resource-ID field values from the response header.