Multistatus errors

When using Bulk Operations RESTfm returns status differently.

  • If all operations are successful, the HTTP response will always be 200 OK.
  • If one or more operations are unsuccessful, the HTTP response will always be 207 Multi-status, and an additional 'multistatus' section will exist in the response. The 'multistatus' section must be consulted to determine the error for each failed operation.

Note: The 'Status' and 'Reason' codes contained in the 'multistatus' section are from the backend database (FileMaker).

Note2: There is a special case multistatus code: '42409 n conflicting records found' when using a {unique-key-recordID} that is not unique.

Example 1: DELETE message, URI and response

In the following example, one recordID exists and the other does not. In the response, one operation was successful and the other was not. The 'multistatus' section provides additional status and reason for the failed operation.

{
    "meta": [
        {
            "recordID": "9997065"
        },
        {
            "recordID": "9997066"
        }
   ]
}
Example bulk JSON format DELETE message.
{
    "multistatus": [
        {
            "recordID": "9997066",
            "Status": "101",
            "Reason": "Record is missing"
        }
    ],
    "info": {
        "X-RESTfm-Version": "3.0.0beta\/r420",
        "X-RESTfm-Protocol": "4",
        "X-RESTfm-Status": 207,
        "X-RESTfm-Reason": "Multi-status",
        "X-RESTfm-Method": "DELETE"
    }
}
Example bulk JSON format DELETE Multi-status response.

Example 2: DELETE message, URI and response

The following example uses unique-key-recordIDs. One record does not exist the other is non-unique and matches multiple conflicting records

{
    "meta": [
        {
            "recordID": "Pcode===99999999"
        },
        {
            "recordID": "Pcode===0810"
        }
   ]
}
Example bulk JSON format DELETE message with unique-key-recordIDs.

http://demo.restfm.com/RESTfm/postcodes/bulk/brief%20postcodes.json?RFMmethod=delete

{
    "multistatus": [
        {
            "recordID": "Pcode===99999999",
            "Status": "401",
            "Reason": "No records match the request"
        },
        {
            "recordID": "Pcode===0810",
            "Status": 42409,
            "Reason": "15 conflicting records found"
        }
    ],
    "info": {
        "X-RESTfm-Version": "3.0.0beta\/r427",
        "X-RESTfm-Protocol": "4",
        "X-RESTfm-Status": 207,
        "X-RESTfm-Reason": "Multi-status",
        "X-RESTfm-Method": "DELETE"
    }
}

Example bulk JSON format DELETE Multi-status response with unique-key-recordIDs.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us