URI /RESTfm/{database}/layout/{layout} Create - POST

URI /RESTfm/{database}/layout/{layout}

Creates a new record in given {database} and {layout} from the fields provided. Returns the full data of the created record.

Optional query string parameters

RFMsuppressData Set flag to suppress 'data' section from response.
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": [
        {
            "Pcode": "9999",
            "Locality": "A New Location"
        }
    ]
}
Example JSON format HTTP POST message.
http://demo.restfm.com/RESTfm/postcodes/layout/brief%20postcodes.json
{
    "data": [
        {
            "Pcode": "9999",
            "Locality": "A New Location",
            "State": "",
            "Comments": ""
        }
    ],
    "meta": [
        {
            "recordID": "5884344",
            "href": "\/RESTfm\/postcodes\/layout\/brief%20postcodes\/5884344.json"
        }
    ],
    "info": {
        "X-RESTfm-Version": "2.0.1\/r280",
        "X-RESTfm-Protocol": "4",
        "X-RESTfm-Status": 201,
        "X-RESTfm-Reason": "Created",
        "X-RESTfm-Method": "POST"
    }
}
Example JSON format HTTP POST response.

XML format

<?xml version="1.0" encoding="UTF-8"?>
<resource>
 <data>
  <row>
   <field name="Pcode">9999</field>
   <field name="Locality">A New Location</field>
  </row>
 </data>
</resource>
Example XML format HTTP POST message.
<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns="http://www.restfm.com">
 <meta>
  <row>
   <field name="recordID">10113631</field>
   <field name="href">/RESTfm/postcodes/layout/brief%20postcodes/10113631.xml</field>
  </row>
 </meta>
 <data>
  <row>
   <field name="Pcode">9999</field>
   <field name="Locality">A New Location</field>
   <field name="State"></field>
   <field name="Comments"></field>
  </row>
 </data>
 <info>
  <field name="X-RESTfm-Version">3.0.0beta/r430</field>
  <field name="X-RESTfm-Protocol">4</field>
  <field name="X-RESTfm-Status">201</field>
  <field name="X-RESTfm-Reason">Created</field>
  <field name="X-RESTfm-Method">POST</field>
 </info>
 <metaField>
  <row>
   <field name="name">Pcode</field>
   <field name="autoEntered">0</field>
   <field name="global">0</field>
   <field name="maxRepeat">1</field>
   <field name="resultType">text</field>
  </row>
  <row>
   <field name="name">Locality</field>
   <field name="autoEntered">0</field>
   <field name="global">0</field>
   <field name="maxRepeat">1</field>
   <field name="resultType">text</field>
  </row>
  <row>
   <field name="name">State</field>
   <field name="autoEntered">0</field>
   <field name="global">0</field>
   <field name="maxRepeat">1</field>
   <field name="resultType">text</field>
  </row>
  <row>
   <field name="name">Comments</field>
   <field name="autoEntered">0</field>
   <field name="global">0</field>
   <field name="maxRepeat">1</field>
   <field name="resultType">text</field>
  </row>
 </metaField>
</resource>
Example XML format HTTP POST response.

Changelog

Version Description
3.0.0 Added RFMsuppressData query string flag.
2.0.2 Added RFMurlencoded query string flag.
< 2.0.0 Prior to version 2.0.0 the response simply appeared as:201 Created
1.1.0 Added RFMscriptRFMscriptParamRFMpreScript and RFMpreScriptParam query string parameters.
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