Services/Sync/Server/Archived/0.3/API/ResponseCodes: Difference between revisions

From MozillaWiki
< Services‎ | Sync‎ | Server‎ | Archived‎ | 0.3/API
Jump to navigation Jump to search
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
= Weave 0.3 API Response Codes =
= Weave API Response Codes =


'''200 OK''' -- Returned on a successful request. Note that this does not guarantee that the server has done anything - deleting a nonexistent object will return a 200. The request body will contain the data expected from the transaction.
'''200 OK''' -- Returned on a successful request. Note that this does not guarantee that the server has done anything - deleting a nonexistent object will return a 200. The request body will contain the data expected from the transaction or a timestamp associated with the action.


'''400 Bad Request''' -- Will be returned if there was an error in the client's request. Details of the request will be contained in the body code:
'''400 Bad Request''' -- Will be returned if there was an error in the client's request. Details of the request will be contained in the body code:
Line 33: Line 33:
| 8
| 8
| Invalid Weave Basic Object
| Invalid Weave Basic Object
|- valign="top"
| 9
| Requested password not strong enough
|- valign="top"
| 10
| Invalid/missing password reset code
|- valign="top"
| 11
| Unsupported function
|}
|}


Line 39: Line 48:


'''404 Not Found''' -- Returned if the user does not exist. Body does not contain anything useful.
'''404 Not Found''' -- Returned if the user does not exist. Body does not contain anything useful.
'''412 Precondition Failed''' -- Returned if data in the collection has been updated since the timestamp specified in the X-If-Unmodifed-Since http header.


'''503 Service Unavailable''' -- An internal error (storage failure). Please try back again later. Some explanation may be available in the body.
'''503 Service Unavailable''' -- An internal error (storage failure). Please try back again later. Some explanation may be available in the body.

Latest revision as of 03:07, 12 July 2010

Weave API Response Codes

200 OK -- Returned on a successful request. Note that this does not guarantee that the server has done anything - deleting a nonexistent object will return a 200. The request body will contain the data expected from the transaction or a timestamp associated with the action.

400 Bad Request -- Will be returned if there was an error in the client's request. Details of the request will be contained in the body code:

Code Description
1 Illegal method/protocol
2 Incorrect/missing captcha
3 Invalid/missing username
4 Attempt to overwrite data that can't be overwritten (such as creating a userid that already exists)
5 Userid must match account in path (if set in config)
6 Json parse failure
7 Missing password field
8 Invalid Weave Basic Object
9 Requested password not strong enough
10 Invalid/missing password reset code
11 Unsupported function


401 Unauthorized -- Valid username and password required.

404 Not Found -- Returned if the user does not exist. Body does not contain anything useful.

412 Precondition Failed -- Returned if data in the collection has been updated since the timestamp specified in the X-If-Unmodifed-Since http header.

503 Service Unavailable -- An internal error (storage failure). Please try back again later. Some explanation may be available in the body.