Difference between revisions of "Status codes"

From LabTrove Documentation
Jump to: navigation, search
(What to do next)
m (9 revisions imported)
 
(No difference)

Latest revision as of 17:08, 31 July 2017

Status codes returned by the REST API[edit]

The LabTrove REST API returns status codes and reason phrases that comply with the HTTP conventions described in RFC 2616 at http://www.ietf.org/rfc/rfc2616.txt

Some of the status codes are generic: LabTrove can return them for any action. Other codes are specific to the addpost and editpost actions; some are specific to the editpost action only. There are no codes specific to the adddata action.

HTTP code 500 corresponds to Internal Server Error: LabTrove returns a variety of reason phrases for code 500.

Generic codes[edit]

200 OK - Action successfully received, understood, and accepted
401 Unauthorised - The UID has authorisation level 0 or is unknown
404 action: Action Not Found - Check the spelling of the action
500 Received XML did not parse - LabTrove could not understand the XML data

Codes for addpost and editpost[edit]

401 Unauthorised For that blog - The UID is not authorised to add or edit posts on the Notebook
401 Unauthorised to post as someone else - The UID does not have Administrator authorisation level
500 blog or blog_sname not set - Required information not supplied in XML data
500 blog not found - The Trove has no Notebook corresponding to the blog_sname supplied
500 Unknown author - The Trove does not recognise the username supplied in the XML data
500 no title set - Required information not supplied in XML data
500 no section set - Required information not supplied in XML data
500 no author set - Required information not supplied in XML data
500 no content set - Required information not supplied in XML data

Codes for editpost only[edit]

401 Unauthorised to edit someone else's post - The UID does not have Editor or Administrator authorisation level
500 blog post not found - The Trove has no post corresponding to the post id supplied
500 no edit reason - The mandatory edit_reason element was empty or was not supplied

What to do next[edit]