Case API returning "record not found" when querying with number

richardphon
Tera Contributor

Hi,

 

I have a problem with case API. When i used the GET with the case number to query case by id, the result is "record not found". If i changed to the case sys_id, everything works fine.

 

Does anyone had the issue and had resolved it ?

 

Thanks,

 

5 REPLIES 5

Shruti
Mega Sage
Mega Sage

Hi

Check the query and compare URI

Shruti_0-1762342599761.png

Shruti_1-1762342700732.png

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@richardphon 

it's an OOTB scripted REST API and here is the info, you can see which endpoint and HTTP Method is good for you

AnkurBawiskar_0-1762342905154.png

it worked for me as admin with Both Number

AnkurBawiskar_1-1762342983772.png

 

AnkurBawiskar_2-1762343025604.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi Ankur,

 

Thank you, i think the script has been modify. Can you provide me the original script ?

 

Thanks,

@richardphon 

sure here is the link, replace it with your instance name

https://instanceName.service-now.com/nav_to.do?uri=sys_ws_definition.do?sys_id=771aaa2f5342030097a2ddeeff7b127d

AnkurBawiskar_0-1762419976889.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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