Alternative {recordID} format - {unique-key-recordID}

{recordID} is a record identifier used internally by FileMaker, this is always unique and should be sufficient for common use. In some cases it may be impractical (i.e. if the identifier changes due to deletion + re-insertion of a record). RESTfm provides an alternate format by allowing a specified fieldName=uniqueValue in place of any {recordID}. This is known as {unique-key-recordID}.

The uniqueValue should be in the same format as a FileMaker Find. e.g. an exact match for 1234 would be ==1234

An error will result if the find fieldName=uniqueValue does not return single (unique) record.

The entire fieldName=uniqueValue string should be URL encoded if used as part of a URI.

Note: This is not a query string parameter, but a part of the URI itself. Therefore the equals sign should also be encoded.

e.g. for the field myField and the unique value to find ==1234, the entire string would be myField===1234, when URL encoded would appear as: myField%3D%3D%3D1234. This string is now a valid replacement for any occurrence of {recordID} in any RESTfm URI.

Example URI and response

{
    "data": [
        {
            "Pcode": "0811",
            "Locality": "CASUARINA",
            "State": "NT",
            "Comments": "PO Boxes"
        }
    ]
}
Example JSON format GET response using a unique-key-recordID. Abridged result, only 'data' section shown.

Example error response

{
    "data": [
        
    ],
    "meta": [
        
    ],
    "info": {
        "X-RESTfm-Version": "2.0.1\/r280",
        "X-RESTfm-Protocol": "4",
        "X-RESTfm-Status": 409,
        "X-RESTfm-Reason": "11 conflicting records found",
        "X-RESTfm-Method": "GET"
    }
}
Example JSON format GET error response from a non-unique recordID. 

Changelog

Version Description
2.0.0 Added support for {unique-key-recordID}.
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