- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 05:59 AM
Hi everyone,
I actually implement outbound rest calls for getting information from msft azure, through Graph API v1.0.
I'm facing an issue while executing following rest call :
https://graph.microsoft.com/v1.0/users?$select=id,displayName&$filter=assignedLicenses/any(x:x/skuId eq XXXXXXXX)
(obviously, XXX is the skuId of my software product model)
When I test my outbound rest call, I have following error message :
Error executing REST request: Invalid uri 'https://graph.microsoft.com/v1.0/users?$select=id,displayName&$filter=assignedLicenses/any(x:x/skuId eq 05e9a617-0261-4cee-bb44-138d3ef5d965)': Invalid query
I'm pretty sure that my syntax is correct, because I've executed it from another tool. But here, it seems that Service now blocks my request, because it considers that the syntax is incorrect...
Could anyone help me on this issue ?
Thanks a lot !
Regards.
Solved! Go to Solution.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2022 01:57 AM
Hi Tony,
Thanks for your answer.
You're right, specific characters (and format) were blocked by Service Now.
We finally resolved our issue by encoding these caracters, like this :
https://graph.microsoft.com/v1.0/users?$select=id,displayName,userPrincipalName&$filter=assignedLicenses%2Fany(x%3Ax%2FskuId%20eq%20${skuId})
It works now !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 06:58 PM
Hi, how are you constructing the endpoint?
If using 1 'string' you may find that it is not seen as a valid URI as it contains non compliant characters
and that you can resolve this by using queryParameters for your 'select' and 'filter' components.
https://developer.servicenow.com/dev.do#!/reference/api/rome/server/sn_ws-namespace/c_RESTMessageV2API?navFilter=setQueryParameter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2022 01:57 AM
Hi Tony,
Thanks for your answer.
You're right, specific characters (and format) were blocked by Service Now.
We finally resolved our issue by encoding these caracters, like this :
https://graph.microsoft.com/v1.0/users?$select=id,displayName,userPrincipalName&$filter=assignedLicenses%2Fany(x%3Ax%2FskuId%20eq%20${skuId})
It works now !