URI /RESTfm/{database}/layout/{layout}/{recordID} Update - PUT
URI /RESTfm/{database}/layout/{layout}/{recordID}
Updates a single record identified by the FileMaker internal {recordID} from {database} and {layout}, with the fields provided.
Only the provided fields are updated. Absent fields are not modified in any way.
Optional {recordID} format - {unique-key-recordID}
<fieldName>=<uniqueValue> | May be used in place of the FileMaker internal record identifier {recordID}. The uniqueValue should be in the same format as a FileMaker Find. e.g. an exact match for '1234' would be '==1234' The entire string should be URL encoded. e.g. 'myField===1234', when URL encoded, becomes: 'myField%3D%3D%3D1234' |
Optional query string parameters
RFMappend | Append submitted data to existing field data rather than overwriting. |
RFMelsePOST | If {recordID} exists, field data is updated as normal, else perform a {layout} level POST (Create) operation instead. |
RFMurlencoded | Allows uploaded data to be in application/x-www-form-urlencoded format Response remains in the specified format. |
RFMscript=<name> | URL encoded script name to be called after result set is generated and sorted. |
RFMscriptParam=<string> | URL encoded parameter string to pass to script. |
RFMpreScript=<name> | URL encoded script name to be called before performing the find and sorting the result set. |
RFMpreScriptParam=<string> | URL encoded parameter string to pass to pre-script. |
Example message, URI and response
JSON format
{ "data": [ { "Locality": "Updated Location" } ] }
Example JSON format HTTP PUT message.
{ "data": [ ], "meta": [ ], "info": { "X-RESTfm-Version": "2.0.1\/r280", "X-RESTfm-Protocol": "4", "X-RESTfm-Status": 200, "X-RESTfm-Reason": "OK", "X-RESTfm-Method": "PUT" } }
Example JSON format HTTP PUT response.
XML format
<?xml version="1.0" encoding="UTF-8"?> <resource> <data> <row> <field name="Locality">Updated Location</field> </row> </data> </resource>
Example XML format HTTP PUT message.
http://demo.restfm.com/RESTfm/postcodes/layout/brief%20postcodes/5884344.xml
<?xml version="1.0" encoding="UTF-8"?> <resource xmlns="http://www.restfm.com"> <info> <field name="X-RESTfm-Version">3.0.0beta/r430</field> <field name="X-RESTfm-Protocol">4</field> <field name="X-RESTfm-Status">200</field> <field name="X-RESTfm-Reason">OK</field> <field name="X-RESTfm-Method">PUT</field> </info> </resource>
Example XML format HTTP PUT response.
Common error responses
{ "data": [ ], "meta": [ ], "info": { "X-RESTfm-FM-Status": "101", "X-RESTfm-FM-Reason": "Record is missing", "X-RESTfm-Version": "2.0.1\/r280", "X-RESTfm-Protocol": "4", "X-RESTfm-Status": 404, "X-RESTfm-Reason": "Not Found", "X-RESTfm-Method": "PUT" } }
Example JSON format PUT error response from nonexistent {recordID}.
{ "data": [ ], "meta": [ ], "info": { "X-RESTfm-FM-Status": null, "X-RESTfm-FM-Reason": "Field Not Found", "X-RESTfm-Version": "2.0.1\/r280", "X-RESTfm-Protocol": "4", "X-RESTfm-Status": 500, "X-RESTfm-Reason": "FileMaker Error", "X-RESTfm-Method": "PUT" } }
Example JSON format PUT error response from nonexistent field.
Changelog
Version | Description |
---|---|
2.0.2 | Added RFMurlencoded query string parameter. |
2.0.0 | Added support for {unique-key-recordID}. Added support for RFMappend and RFMelsePOST query string parameters. |
< 2.0.0 | Prior to version 2.0.0 the success response appeared as:204 No Content Error responses appeared as: Error 404 (101: Record is missing) Error 500 (: Field Not Found) |
1.1.0 | Added RFMscript, RFMscriptParam, RFMpreScript and RFMpreScriptParam query string parameters. |