Forum Discussion

jsmyth's avatar
jsmyth
Contributor
10 years ago

http response codes

Hi,

 

I am new to Lithium so apologies if I ask a simple/already answered question.

 

If I make a call to an endpoint which doesn't exist e.g. http://forum.oursite.com/restapi/vc/categories/id/100we where '100we' is an unknown resource, I get a HTTP 200 return code and a response body with an embedded error code of error - 101, whereas, I would have expected to get a 404 - Not found.

 

I did find a thread in the forums which outlines the Lithium error codes (below), but I guess I would ask why the HTTP response codes are not as expected, and in addition, would appreciate any views on the level of REST compliance supported by Lithium (I appreciate that REST isnt a specification!)

https://community.lithium.com/t5/Developers-Discussion/Is-there-a-list-of-REST-API-Error-Codes/m-p/143122/highlight/true#M5634

 

thanks

jim

  • VenkS's avatar
    VenkS
    Lithium Alumni (Retired)

    Hopefully this list should cover most (if not all) codes:

    100: Internal exception/User banned

    101: Object lookup fail

    102: Object already exists with unique ID

    301: Invalid session key

    302: User authentication failed

    303: Permission denied, user not fully registered, feature not enabled

    304: Permission denied for IP

    305: Read or modify not allowed for user from session cookie

    306: Feature not configured

    307: Invalid cross origin request

    308: OAuth2 authentication failed

    309: Referrer check failed

    400: API exception

    • JohnD's avatar
      JohnD
      Khoros Alumni (Retired)
      I've added this info into the Doc KB Common questions and listed you as author. Let me know if there is any additional info I should provide.
  • This is a limitation in the implementation of the current Lithium API. However, the new version (not yet GA) addresses this with appropriate HTTP response codes.