REST API: How to GET all incidents for one caller by email address (user id)?

Joseph60
Kilo Contributor

Hello Community! Very new to SN, please bear with me 😉

I am developing an application that needs to do a REST GET that returns any/all incidents for one caller, based on the email address.  I can mostly figure out how to filter the results to just the ones I want, but the only uniquely identifying information I have is the caller's email address.  From what I can see in my company's SN this is what is being used for the User ID (when I click on a caller in the instance table, the user detail I am shown has the email in the user id field).

What I can't seem to figure out is how to get from someone's email address to all of the Incidents that belong to them.

Any help is greatly appreciated. Thanks in advance.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Joseph,

use this endpoint:

you can give your instance name and the email address of the caller

HTTP Method: GET

Endpoint: https://instanceName.service-now.com/api/now/table/incident?sysparm_query=caller_id.user_name%3Dadmin%40example.com

ensure you use %3D for = and %40 for @ while forming the endpoint

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Joseph,

use this endpoint:

you can give your instance name and the email address of the caller

HTTP Method: GET

Endpoint: https://instanceName.service-now.com/api/now/table/incident?sysparm_query=caller_id.user_name%3Dadmin%40example.com

ensure you use %3D for = and %40 for @ while forming the endpoint

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur,

I am trying to get user details based on the email address. Still its giving authentication error. Not sure, what I am missing here.

https://<instance>.service-now.com/api/now/table/sys_user?sysparm_query=user_name%3Dtestuser%40ex.com

Joseph60
Kilo Contributor

Thank you.  And yes, I  understand that the endpoint must be "url encoded". 🙂