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.

Bulk URI - JSON - DELETE Message

1
2
3
4
5
6
7
8
9
10
{
    "meta": [
        {
            "recordID": "9997065"
        },
        {
            "recordID": "9997066"
        }
   ]
}
Example bulk JSON format DELETE message.

Bulk URI - JSON - DELETE Multi-status Response

http://demo.restfm.com/RESTfm/postcodes/bulk/brief%20postcodes.json?RFMmethod=delete
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
    "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.

Bulk URI - JSON - DELETE unique-key-recordID Multi-status Message

1
2
3
4
5
6
7
8
9
10
{
    "meta": [
        {
            "recordID": "Pcode===99999999"
        },
        {
            "recordID": "Pcode===0810"
        }
   ]
}
Example bulk JSON format DELETE message with unique-key-recordIDs.

Bulk URI - JSON - DELETE unique-key-recordID Multi-status Response

http://demo.restfm.com/RESTfm/postcodes/bulk/brief%20postcodes.json?RFMmethod=delete
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "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.