Foundation Data & Integrations
JSON REST API
POST Request - Creating new records
3 min
post requests allow you to insert new records into the system url format single record the format to insert a single record is https //\[instance url]/v1/\[table name] https //docs servicely atlassian net/wiki/spaces/sd/pages/2077556747/get+request+ +retrieving+records# example https //sandbox servicely ai/v1/incident https //sandbox servicely ai/v1/incident/8291a83ece8811ebb1870242ac14001a example create new incident record ➜ https post https //sandbox servicely ai/v1/incident \\ shortdescription="test incident" \\ assignmentgroup=c0a8016c683a1d8581683ac89c54233c \\ classification=c0a805c8685e1cde81685e406ffd325f \\ requestor=4028818a3b214291013b21504a000000 \\ requestedfor=4028818a3b214291013b21504a000000 http/1 1 200 ok content encoding gzip content length 543 content type application/json vary accept encoding, user agent x rate limit cost 1 x result count 1 x result more false x total result count 1 { "data" { "assignmentgroup" "c0a8016c683a1d8581683ac89c54233c", "classification" "c0a805c8685e1cde81685e406ffd325f", "closed" false, "createdby" "4028818a3b214291013b21504a000000", "createdon" "2021 06 16t11 37 02 171z", "firstcontactresolved" false, "impact" "medium", "majorincident" false, "number" "inc0000004", "version" 2, "workflowstatus" "new", "id" "2afed7d4ce9711ebb1870242ac14001a" } } errors records will go through validation before being updated if the record fails validation, the service will reply with a http error code of 400 and a list of reasons why the validation failed ➜ https post https //sandbox servicely ai/v1/user email="not an email" http/1 1 400 bad request content length 134 content type application/json { "errors" { "request" \[ "custom 40006 error evaluating validation rule 'user check email address' (unspecified)" ] } }