Commits

Greg Salt committed 14a7f88

Further response codes work

Comments (0)

Files changed (1)

docs/updater/response-codes.rst

-.. highlight:: json
-
 Response Codes
 ==============
 
+The status shows whether the update will be accepted or rejected by the API.
+
 200 Ok
 -------
 
+**Status:** Accepted/Rejected
+ 
 .. code-block:: json
 
    {"code": 200, "message": "Ok"}
 402 Resource exists
 -------------------
 
+**Status:** Rejected
+
 .. code-block:: json
 
    {"code": 402, "message": "Resource exists"}
 403 Not allowed
 ---------------
 
+**Status:** Rejected
+
 .. code-block:: json
 
    {"code": 403, "message": "Not allowed"}
 404 Resource does not exist
 ---------------------------
 
+**Status:** Rejected
+
 .. code-block:: json
 
-   404 Resource does not exist
+   {"code": 404, "message": "Resource does not exist"}
 
 If you've modified the library then make sure that the API endpoints are correct.
 
 501 Incorrect user agent
 ------------------------
 
+**Status:** Rejected
+
+.. code-block:: json
+
     {"code": 501, "message": "Incorrect user agent"}
 
 You must use ``Cerberus Updater 1.0`` as the user agent. The library does set this automatically but if you use your own cURL method then you should set this appropriately.
 502 Invalid remote host
 -----------------------
 
+**Status:** Rejected
+
+.. code-block:: json
+
     {"code": 502, "message": "Invalid remote host"}
 
 Make sure that your hostname matches the one you registered. Subdomains are counted are separate hosts. For example, ``www.domain.com`` requires a different access key from ``domain.com``.
 
 503 Unable to find access key
+-----------------------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 503, "message": "Unable to find access key"}
+
+You may see this response if there is a problem with Cerberus or if your account has been disabled.
+
 504 Data too long
+-----------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 504, "message": "Data too long"}
+
+You can only send a maximum of 100 members at any one time. You may also see this response if you are using the test method and you try and send a message of more then 500 characters.
+
 505 Unable to decrypt
+---------------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 505, "message": "Unable to decrypt"}
+
+Make sure that you use the correct access key for you host.
+
 506 Invalid POST data
+---------------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 506, "message": "Invalid POST data"}
+
+You must make sure that you send an array of arrays of member data.
+
 507 Invalid data format
+-----------------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 507, "message": "Invalid data format"}
+
+You must send ``username``, ``screen_name``, ``email``, ``ip_address`` and ``url`` keys in the member array.
+
 508 Duplicate host update
+-------------------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 508, "message": "Duplicate host update"}
+
+
 509 Unknown error
+-----------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 509, "message": "Unknown error"}
+
+This indicates a problem with the Cerberus network. Please try sending your data again.
+
 510 Invalid member data
+-----------------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 510, "message": "Invalid member data"}
+
+If you are sending data without validating it as a valid member registration then you may find that the member keys have invalid data.
+
 511 Unable to base64 decode
+---------------------------
+
+**Status:** Rejected
+
+.. code-block:: json
+
+   {"code": 511, "message": "Unable to base64 decode"}
+
+You are encrypting and encoding the data with your own methods then you must replicate the original library functionality.
+
 512 Unable to decode JSON
 513 Username not valid
 514 Screen name not valid