- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 09:32 PM
Documentation says that this curl will work:
curl "https://instance.servicenow.com/api/sn_chg_rest/v1/change" \ --request PATCH \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data "{\"short_desription\": \"Reboot server on scheduled interval\", }" \ --user "username":"password"
That's wrong however, and needs to be POST.
Using POST, get the response:
Change Request cannot be created with invalid parameters: {\"short_desription\":[\"Reboot server on scheduled interval\"],
Name-value pairs for the fields to update. Request body parameters override URL parameters. However, required parameters must be specified in the URL.
Still don't know what the required parameters are.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 11:26 PM
Its working via this method also
curl "https://dev11880.service-now.com/api/sn_chg_rest/change/normal" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{\"requested_by\":\"Abel Tuter (Architect)\",\"short_description\":\"testing via post API using change rest\"}" \
--user 'admin':'admin'
Result
You have to define type of change
check from servicenow rest api explorer
If its helpful,please mark answer as correct
Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 11:26 PM
Its working via this method also
curl "https://dev11880.service-now.com/api/sn_chg_rest/change/normal" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{\"requested_by\":\"Abel Tuter (Architect)\",\"short_description\":\"testing via post API using change rest\"}" \
--user 'admin':'admin'
Result
You have to define type of change
check from servicenow rest api explorer
If its helpful,please mark answer as correct
Anshu