Use the POST method to update or insert a resource.
To update a resource, you must specify the ID of the resource. To create a resource, you must specify the primary key and all the required fields that do not have a default value, but no ID is required.
To update or insert an object structure resource, you can specify the _action parameter to identify actions that the integration framework provides, such as Change or AddChange.
To update or insert a child object of an object structure resource, the form data must identify each occurrence of the child object.
When you use the POST method to create a resource, specify the _ulcr query parameter with a value of 1 so that the response includes a link for the client to access the new resource. Otherwise, the content of the resource is included in the response. The link is included in the Location header property and the HTTP response code is 201 to identify that a link is provided instead of the data.
POST maxrest/rest/mbo/asset HTTP/1.1
assetnum=127&siteid=BEDFORD&description=my_new_description&type=OPERATING
POST maxrest/rest/mbo/asset/1234 HTTP/1.1
description=my_new_description&type=OPERATING
POST maxrest/rest/mbo/asset/968 HTTP/1.1
_action=Change&description=my_new_description
POST maxrest/rest/os/mxpo/1234 HTTP/1.1
description=new_po_desc&
poline.id1.polinenum=1&poline.id1.item=ABC&poline.id1.description=new_description&
poline.id1.pocost.id1-1.costlinenum=1&poline.id1.pocost.id1-1.gldebitacct=new_gl_acct_a&
poline.id1.pocost.id1-2.costlinenum=2&poline.id1.pocost.id1-2.gldebitacct=new_gl_acct_b&
poline.id2.polinenum=2&poline.id2.item=XYZ&poline.id2.description=new_description&
poline.id2.pocost.id2-1.costlinenum=1&poline.id2.pocost.id2-1.gldebitacct=new_gl_acct_c&
poline.id2.pocost.id2-2.costlinenum=2&poline.id2.pocost.id2-2.gldebitacct=new_gl_acct_d&
In
the example, the identifiers identify the following parameters:Group identifier | Parameters identified |
---|---|
id1 | Parameters that belong to poline 1 |
id1-1 | Parameters that belong to pocost 1 for poline 1 |
id1-2 | Parameters that belong to pocost 2 for poline 1 |
id2 | Parameters that belong to poline 2 |
id2-1 | Parameters that belong to pocost 1 for poline 2 |
id2-2 | Parameters that belong to pocost 2 for poline 2 |