Reference : JSON REST API reference : Element collection : POST method
  
POST method
Use the POST method to create a new element in a module.
The following example uses the POST method to create new elements where the user must have administrator permission for creating elements in the module.
URL: https://fpserver.com:9443/fp/resources/workspaces/3/modules/1/elements/.json
Accept header: application/json
Request body:
{"attributes":[{"Title":{"textValue":"Elem005"}},{"Choice":{"value":"Implemented"}},{"Date":{"value":"2021-11-22T00:00:00+05:30"}},{"Integer":{"value":"50"}},{"Link":{"value":"https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/40"}},{"List":{"linklist":[{"value":"https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/99?view=23"},{"value":"https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/102?view=23"}]}}]}
Supported parameters for the POST method
The following parameters can be used with the POST method:
optimize
Set the optimize parameter to true to optimize element creation.
Type: Boolean
Using the POST method with the view parameter
The following example shows the method that allows non-administrators to create new elements by using the view parameter.
URL: https://fpserver.com:9443/fp/resources/workspaces/3/modules/1/elements/.json?view=200&optimize=true
Accept header: application/json
Request body:
{"attributes":[{"Title":{"textValue":"Elem005"}},{"Choice":{"value":"Implemented"}},{"Date":{"value":"2021-11-22T00:00:00+05:30"}},{"Integer":{"value":"50"}},{"Link":{"value":"https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/40"}},{"List":{"linklist":[{"value":"https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/99?view=23"},{"value":"https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/102?view=23"}]}}]}
Multipart POST method
The following example uses the POST method to update multiple attributes through one HTTP request. The content type for this request is multipart/related. You can use the POST method only to add or delete element links.
URL: https://fpserver.com:9443/fp/resources/workspaces/5/modules/1/elements/.json
Accept header: multipart/related
Request body:
{"attributes":[{"elementId":"114","attributeId":"272","addlink":["https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/102","https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/103"],"deletelink":["https://fpserver.com:9443/fp/resources/workspaces/116/modules/13/elements/32"]}]}
Go up to
Element collection