错误 - API

错误代码

我们的 API 将根据您请求的成功返回语义上有效的 HTTP 响应代码。下表可用作它将返回的响应代码的参考。

每个错误都用 HTTP 状态代码以及实际响应正文中的代码和响应消息表示。

HTTP 状态码

如果一个 HTTP 状态码有多种原因,请使用 API 返回的错误码。

HTTP 意义
200 Success
400
  • Missing or invalid argument
  • Endpoint not valid
  • Endpoint resource not valid
  • You cannot access this resource using %(request_method)s
  • You cannot access this resource using your %(access_type)s API key
  • This operation is not supported
  • Your API key is not valid on this domain
  • This application does not have enough privileges to access this resource
  • You have exceeded the rate limit for this resource
  • You have exceeded the rate limit for your account
  • The authenticated user does not have access to this feature
  • The authorization signature you passed was not valid
  • You must re-submit this request with a response to the captcha challenge
  • You do not have the appropriate permissions to access this resource
  • You have exceeded the maximum number of creations for this resource
401 You must be authenticated to perform this action
403 Invalid API key
404 A requested object was not found
408 Your request timed out
415 Invalid format
500 There was internal server error while processing your request
503
  • The API is currently undergoing maintenance, and your changes were saved, but will not be visible yet.
  • The API is currently undergoing maintenance, and your changes could not be saved.

错误代码

下表描述了使用 API 时可能出现的代码。

The YouRepo API attempts to return appropriate error codes for every request.

这些规则有一个例外:

  • 无效格式将返回带有错误消息的 HTTP 415 作为响应正文。
代码 意义
0
  • Success
  • Invalid format
1 Endpoint not valid
2 Missing or invalid argument
3 Endpoint resource not valid
4 You must be authenticated to perform this action
5 Invalid API key
7 You cannot access this resource using %(request_method)s
8 A requested object was not found
9 You cannot access this resource using your %(access_type)s API key
10 This operation is not supported
11 Your API key is not valid on this domain
12 This application does not have enough privileges to access this resource
13 You have exceeded the rate limit for this resource
14 You have exceeded the rate limit for your account
15 There was internal server error while processing your request
16 Your request timed out
17 The authenticated user does not have access to this feature
18 The authorization signature you passed was not valid
19 You must re-submit this request with a response to the captcha challenge
20 The API is currently undergoing maintenance, and your changes were saved, but will not be visible yet.
21 The API is currently undergoing maintenance, and your changes could not be saved.
22 You do not have the appropriate permissions to access this resource
24 You have exceeded the maximum number of creations for this resource