Unable to update sys_update_set_source table using Table API

mansing
Giga Contributor

Hi,

I'm trying to create a remote instance object using REST API however in REST API explorer the table 'sys_update_set_source' shows does not exist. Is there anything wrong I have been doing here?

I am trying to create a new Remote instance with source (dev) SNOW instance URL and credentials so I can move the update sets from dev to QA instance.

find_real_file.png

1 ACCEPTED SOLUTION

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Mansing,



The end point is described here:


curl "https://instance_name.service-now.com/api/now/table/sys_update_set_source" --request POST --header "Accept:application/json" --header "Content-Type:application/json" --data "{\"short_description\":\"test\"}" --user 'admin':'admin'



The REST api explorer will not build the query for you, as the target table is not selectable in the Explorer api.


This is, I suppose, intentional as was not anticipated that it would be useful to use REST on the sys_update_set_source.


I am not so convinced either 😉



If you try the curl code above, it will fail because setting the short description is not sufficient to pass the validation.


Actually the same validation that is applied when creating a new record in sys_update_set_source - name and URL etc


So this fragment   --data "{\"short_description\":\"test\"}" requires extending to populate additional fields.


I suggest trying this in sub prod BTW...



Screen Shot 2017-09-26 at 9.33.38 AM.png




If the reply was informational, please like, mark as helpful or mark as correct!





View solution in original post

12 REPLIES 12

Correct, all tables work the same way, just put the table name at the end of the endpoint, do a GET call so you can see the field structure, and you should be able to figure out any post/put request from there.


Hi Chris,


Good idea! Do a GET call to see the field structure.


for example:



curl "https://instance1.service-now.com/api/now/table/sys_update_set_source/34931b3b13d50700125ad8228144b0..."   --request GET   --header "Accept:application/json"   --user 'admin':'admin'


Thank you guys. Really helpful idea you shared.