GET method call in REST API call is not returning desired data.

Gulzar Manuja2
Kilo Guru

Dear All,

Greetings !!

I am working on a requirement wherein I have to integrate our ServiceNow instance with Sailpoint application. We have received following Endpoint to make a GET method call from Sailpoint in order to fetch record for a specific user.   

https://xxxxxx.api.identitynow.com/v3/accounts?filters=sourceId eq "aaaaaaaa7d7ccfef017d7ed0f3bbbbbb" and name eq "zzzz"

However, when I used this endpoint as it is in the Endpoint field of the GET method, I encountered "Invalid URI" error. I believe the error was thrown by the system as above endpoint has spaces and keywords like 'eq'. Then, I tried to modify this endpoint(as mentioned below) so that the same can be accepted by ServiceNow, however, it did not work correctly. System is fetching all the records from the other system instead of a specific account with name 'zzzz'

https://xxxxxx.api.identitynow.com/v3/accounts?sysparm_query=sourceId%3Daaaaaaaa7d7ccfef017d7ed0f3bbbbbb&name=zzzz

Could someone help me to rectify the issue please? I guess I have not been able to build the query correctly. Would appreciate any input.

 

Thanks & Regards,

Gulzar Manuja

1 ACCEPTED SOLUTION

Hi,

did you try to use %22 which is url encoded value for "

Regards
Ankur

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

View solution in original post

13 REPLIES 13

Hey Ankur,

Yep, the URL is working fine with the Postman. Furthermore, I tried to modify the URL by adding various escape characters and it seems we are close. Apparently there is some issue with escaping double quotes as shown below:

Filter for ease of copy paste: 

api.identitynow.com/v3/accounts?filters=sourceId%20eq%20aaaaaaaa7d7ccfef017d7ed0f3acbbbb%20and%20name%20eq%20xxxx

 

Screenshot of the Parameters and Response: 

find_real_file.png

For ease of reference, SailPoint system expects following request body/endpoint:

https://xxxxxxxxx.api.identitynow.com/v3/accounts?filters=sourceId eq "aaaaaaaa7d7ccfef017d7ed0f3acbbbb" and name eq "xxxx" 

 

Would it be possible for you to check what can I do now ?

 

Best Regards,

Gulzar Manuja

Hi,

did you try to use %22 which is url encoded value for "

Regards
Ankur

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

Thanks for your help Ankur, it worked 🙂

Marking your answer as correct !!!

Best Regards,

Gulzar Manuja

Glad to know.

Please mark appropriate responses helpful as well.

Regards
Ankur

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