The CreatorCon Call for Content is officially open! Get started here.

REST API EXPLORER

Charls Brown
Tera Expert

hi there im trying to get the list of data of this table

find_real_file.png

but when i go to REST   API EXPLORER i cant see it

find_real_file.png

i would appreciate any help

9 REPLIES 9

i would like to get all data from this table when i send i press send using the REST API EXPLORER


find_real_file.png


so in the out come i would like to get this here



find_real_file.png


Hi Carlos,



The REST API Explorer is a developmental test bench to help build REST integrations. It is not intended to be used as a standalone app. Are you trying to build a REST integration with the test table? Please help me understand the "underlying requirement" instead of the "proposed solution". Thank you


Yes, i am trying toa REST integration with the test table. i did this by using this script:



var request = new GlideHTTPRequest('https://dev25125.service-now.com/api/now/table/sys_atf_test_suite');


request.setBasicAuth("rest", "rest");


request.addHeader('Accept', 'application/json');




var response = request.get();



gs.log(response.getStatusCode());


gs.log(response.getBody());




so i was able to get back all the values from the test table using this script.



Carlos


Hi Carlos,



You are on the right track.



Take a look at sn_ws.RESTMessageV2(). It provides similar functionality, but it is better suited to REST integrations and works in scoped apps.



You can get a snippet of it's usage from the link on the REST API Explorer if you use another table (as a test) and then set your endpoint accordingly in the script.


thats great. i have another question using that script in the background-Script its getting my back all data from the test table which is great. Now i want to use that script in a table in the "Run this script" so when user submit the form the sript will be automatic ejecuted and presented the result in another table if possible.




find_real_file.png


this is table i am creating so the script i gave you above it would be in the red box.



is it possible? i appreciate any help provided.