响应状态码

更新时间不可用

查询 RTMP 网关的响应状态码、错误码含义、常见原因和处理建议。

在调用 RTMP 网关 API 过程中,你可能收到如下 HTTP 响应状态码:

  • 如果 HTTP 状态码为 2XX,则请求成功。

  • 如果 HTTP 状态码不为 2XX,则请求失败。你可以根据对应的响应 Body 中可能出现的 message 字段排查问题。

例如,请求失败时,你可能收到如下响应:

JSON
# 400 Bad Request
{
  "message": "appid is invalid"
}

推流码响应状态码

状态码可能的 message 字段内容原因建议措施
200 OK/请求执行成功。无需处理。
400 Bad Request
  • Invalid settings.
  • Parameter 'channel' is invalid formatted.
  • Streamkey exists in region:na.
请求参数错误。根据 message 字段的具体内容进行排查。
401 UnauthorizedInvalid authentication credentials.RESTful API 鉴权失败。重新执行 HTTP 鉴权。
403 Forbidden
  • This project has not enabled RTMP Gateway yet. Contact us to enable it.
  • Stream does not belong to this app ID.
  • 未开通 RTMP 网关服务。
  • 查询的推流码不属于该 App ID。
  • 联系技术支持开通 RTMP 网关服务。
  • 检查传入的 streamKey 和 App ID 是否匹配。
404 Not FoundResource is not found and destroyed.请求的资源不存在。检查传入的 streamKey 是否正确。
409 ConflictResource with the same name already exists.并发请求过多。采取退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
429 Too Many Requests
  • Request rate limit exceeded.
  • Resources quota limit exceeded.
  • No available resources.
并发请求过多。采取退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
500 Internal Server ErrorSome internal error happened. Contact us to help fix it.服务端内部错误。采取退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
503 Service Unavailable
  • Service overload. Retry with back off strategy, and contact us to help fix it.
  • Service unavailable temporarily. Retry with back off strategy.
服务端内部错误。采取退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
504 Gateway TimeoutGateway timeout. Query to check whether the player has been created, or to create another one instead.服务端内部错误。采取退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
表格内容超出当前宽度,可横向滚动查看更多列。

流配置模版响应状态码

下表介绍使用流配置模版时,可能收到的响应状态码、message 字段内容、建议措施。

状态码可能的 message 字段内容原因建议措施
200 OK/请求执行成功。无需处理。
400 Bad Request
  • Invalid settings.
  • invalid template id.
  • missing field: "transcoding.video.enabled".
  • unsupported codec: "AV1".
请求参数错误。参考 HTTP 响应 Body 中的 message 字段进行排查。
401 UnauthorizedInvalid authentication credentials.RESTful API 鉴权失败。重新执行 HTTP 鉴权。
403 Forbidden
  • This project has not enabled RTMPG product yet. Contact us to enable it.
  • too many templates have been created.
  • 未开通服务。
  • 已创建太多流配置模板。
404 Not Foundstream template not found.请求的资源不存在。请检查传入的 templateId 是否正确。
429 Too Many Requests
  • Request rate limit exceeded.
  • Resources quota limit exceeded.
  • no available resources.
并发请求过多。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
500 Internal Server ErrorSome internal error happened. Contact us to help fix it.服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
502 Bad gatewayInternal errors. Contact us for troubleshooting.服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
503 Service Unavailable
  • Service overload. Retry with back off strategy, and contact us to help fix it.
  • Service unavailable temporarily. Retry with back off strategy.
服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
504 Gateway TimeoutGateway timeout. Query to check whether the player has been created, or to create another one instead.服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
表格内容超出当前宽度,可横向滚动查看更多列。

对在推流进行操作状态码

下表介绍查询操作在推流时,可能收到的响应状态码、message 字段内容、建议措施。

状态码可能的 message 字段内容原因建议措施
200 OK/请求执行成功。无需处理
400 Bad Request
  • Invalid Body.
  • invalid appid.
  • sid is missing.
请求参数错误。参考 HTTP 响应 Body 中的 message 字段进行排查。
401 UnauthorizedInvalid authentication credentials.RESTful API 鉴权失败。重新执行 HTTP 鉴权。
403 ForbiddenThis project has not enabled RTMPG product yet. Contact us to enable it.未开通服务。联系技术支持开通 RTMP 网关服务。
404 Not Found/请求的资源不存在。请检查传入的 sid 是否正确。
429 Too Many Requests
  • Request rate limit exceeded.
  • Resources quota limit exceeded.
  • no available resources.
并发请求过多。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
500 UnknownSome internal error happened. Contact us to help fix it.服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
502 Bad gatewayInternal errors. Contact us for troubleshooting.服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
503 Service Unavailable
  • Service overload. Retry with back off strategy, and contact us to help fix it.
  • Service unavailable temporarily. Retry with back off strategy.
服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
504 Gateway TimeoutGateway timeout. Query to check whether the player has been created, or to create another one instead.服务端内部错误。采用退避策略重试。例如,第一次等待 1 秒后重试,第二次等待 3 秒后重试,第三次等待 6 秒后重试。
表格内容超出当前宽度,可横向滚动查看更多列。