Querying for endpoint fields - REST API

dominique_penni
Kilo Explorer

Hey all,

I'm working on a REST api integration and I'm having trouble finding a way to programmatically find the fields that are to be expected by a particular endpoint.

Is there a way perform a query, such that, I could make a call to an endpoint similar to:

Then, in response, get a list of the fields (and hopefully field datatypes) that this will return.

I've seen this referred to as a "describe" request elsewhere.

Thank you!

5 REPLIES 5

prasad48
Tera Guru

Ah - Thanks sorry.



I made that a bit unclear.



What I meant is... Is there a way to find out what fields the request:


GET https://dev43415.service-now.com/api/now/table/sys_user


will return?


As you know table API will return all fields in that table .Are you expecting columns under a table?


An example would be retrieving the name of the response results fields for this endpoint.



https://developer.servicenow.com/app.do#!/rest_api_doc?v=jakarta&id=r_TableAPI-GET



So if the endpoint response is:




  "result": [
    {
    "parent": "",
    "made_sla": "true",
    "watch_list": ""




I would want a list of "parent, made_sla, watch_list" and maybe the field data types.