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

How to fetch Single Record by using Get Method through using TABLE API in REST API?

ram2497
Tera Contributor

How to fetch Single Record by using Get Method at TABLE API in REST API?

Please provide examples.

Thanks

 

8 REPLIES 8

Sudhanshu Talw1
Tera Guru

Hi,

  • Open REST API EXPLORER.
  • Select the table name.
  • From left choose GET
  • Set sysparm_limit to 1
  • Click on the send button
  • Find screenshot attached & you can use sysparm_query to select a particular record such as user_name="abc". it will return user with username abc.

 

You will get the response.

 

Thanks

Sudhanshu 

MrMuhammad
Giga Sage

Hi,

If you want single specific record then you can append the sys_id in the end point to fetch the required record. An example endpoint will be something like below which will get incident based on provided sys_id.

/api/now/v1/table/incident/{sys_id}

if you want to randomly get 1 record then you need to pass query parameter sysparm_limit=1 to limit result returned to 1 record. 

Ref - https://docs.servicenow.com/bundle/orlando-application-development/page/integrate/inbound-rest/conce...

 

Thanks,

Sharjeel

Regards,
Muhammad

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ram,

If you want to fetch single record using OOB Table API then you need to know the record sys_id

endpoint something similar to this

https://instanceName.service-now.com/api/now/table/{tableName}/{sys_id}

 

Also most of the times OOB table API is not used as it exposes all the fields to 3rd party

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@ram2497 

Hope you are doing good.

If your query is resolved please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader