Jump to content

API Failure Codes


Dr. McKay

Recommended Posts

Currently, the IGetPrices API (v3) returns a 403 response if it refuses to respond to the request, regardless of the reason. I'd like to propose these alternative codes:

 

401 Unauthorized - No API key provided or invalid API key provided

403 Forbidden - You requested the API too quickly after your previous request

Link to comment
Share on other sites

You've got Brad added? Surely you could just message him

 

(Just cause I see you two talking a lot in chat ^^)

Link to comment
Share on other sites

You've got Brad added? Surely you could just message him

 

(Just cause I see you two talking a lot in chat ^^)

 

He usually just asks me to post here.  :)

Link to comment
Share on other sites

He usually just asks me to post here.  :)

 

mmk, well have no clue what your on about enough to help you! But good luck on your endeavours :lol:  

Link to comment
Share on other sites

Updated, here are a list of codes:

 

403 Forbidden: Invalid API Key

400 Bad Request: No API Key supplied

429 Too Many Requests - Will also contain the retry-after header, indicating how many seconds you need to wait before you retry.

Link to comment
Share on other sites

Steam is failing upon receiving a 429 error code. You need to change it to something out of this list:

 

HTTPStatusCode_BadRequest = 400,
HTTPStatusCode_Unauthorized = 401,
HTTPStatusCode_PaymentRequired = 402,
HTTPStatusCode_Forbidden = 403,
HTTPStatusCode_NotFound = 404,
HTTPStatusCode_MethodNotAllowed = 405,
HTTPStatusCode_NotAcceptable = 406,
HTTPStatusCode_ProxyAuthRequired = 407,
HTTPStatusCode_RequestTimeout = 408,
HTTPStatusCode_Conflict = 409,
HTTPStatusCode_Gone = 410,
HTTPStatusCode_LengthRequired = 411,
HTTPStatusCode_PreconditionFailed = 412,
HTTPStatusCode_RequestEntityTooLarge = 413,
HTTPStatusCode_RequestURITooLong = 414,
HTTPStatusCode_UnsupportedMediaType = 415,
HTTPStatusCode_RequestedRangeNotSatisfiable = 416,
HTTPStatusCode_ExpectationFailed = 417,

I would suggest 412 Precondition Failed, as the "precondition" that's failed is that you don't request prices more than every 60 seconds. You can still set the Retry-After header with the 412 header if you wish.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...