Table API cURL examples

Examples that demonstrate how to use the Table API with the cURL command language.

Example URLs

In the examples, replace myinstance.service-now.com with the URL of your instance.

GET

curl --user admin:admin \
 --header "Accept: application/json" \
 https://myinstance.service-now.com/api/now/table/incident

POST

curl --user admin:admin \
 --header "Content-Type:application/json" \
 --header "Accept: application/json" \
 --request POST \
 --data '{"short_description":"Test with CURL"}' \
 https://myinstance.service-now.com/api/now/table/incident

PUT

curl --user admin:admin \
 --header "Content-Type:application/json" \
 --header "Accept: application/json" \
 --request PUT \
 --data '{"short_description":"Test with CURL Update"}' \
 https://myinstance.service-now.com/api/now/table/incident/bf1defe3d7031100261253b2b2520373

PATCH

curl --user admin:admin \
 --header "Content-Type:application/json" \
 --header "Accept: application/json" \
 --request PATCH \
 --data '{"short_description":"Test with CURL Patch"}' \
 https://myinstance.service-now.com/api/now/table/incident/bf1defe3d7031100261253b2b2520373

DELETE

curl --user admin:admin \
 --header "Content-Type:application/json" \
 --header "Accept: application/json" \
 --request DELETE \
 https://myinstance.service-now.com/api/now/table/incident/bf1defe3d7031100261253b2b2520373

Additional Parameters

To improve the formatting of your JSON response, add | grep }| python -mjson.tool.

curl -i --user admin:admin \
 --header "Accept: application/json" \
 https://myinstance.service-now.com/api/now/table/incident | grep }| python -mjson.tool