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

Layout URI - JSON - POST Message

1
2
3
4
5
6
7
8
{
    "data": [
        {
            "Pcode": "9999",
            "Locality": "A New Location"
        }
    ]
}
Example JSON format HTTP POST message.

Layout URI - JSON - POST Response

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

Layout URI - XML - POST Message

1
2
3
4
5
6
7
8
9
<?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.

Layout URI - XML - POST Response

http://demo.restfm.com/RESTfm/postcodes/layout/brief%20postcodes.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?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 RFMscript, RFMscriptParam, RFMpreScript and RFMpreScriptParam query string parameters.