Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/23/2024 02:20 AM - edited 10/23/2024 02:22 AM
Hi,
We need to perform 2 API calls in AddAccessJSON of REST connector.
1. GET - https://graph.microsoft.com/beta/devices?$search="displayName:MachineName"
2. POST - https://graph.microsoft.com/v1.0/groups/groupID/members/$ref
The #1 API URL is not getting resolved. Following options are attempted
1. "url": "https://graph.microsoft.com/beta/devices?$search=%22displayName%3A'${account.accountID}'%22",
[error:Error Illegal character in query at index 68:
https://graph.microsoft.com/beta/devices?$search=%22displayName%3A'${account.accountID}'%22]
2. "url": "https://graph.microsoft.com/beta/devices?$search=%22displayName%3A${account.accountID}%22",
[error:Error Illegal character in query at index 67:
https://graph.microsoft.com/beta/devices?$search=%22displayName%3A${account.accountID}%22]
3. "url": "https://graph.microsoft.com/beta/devices?$search=\"displayName:${account.accountID}\"",
error:Error Illegal character in query at index 49:
https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}"]
Upon hardcoding the value for ${account.accountid} the API is getting invoked successfully.
Kindly provide suggestions in order resolve this issue.
Thanks,
Prajakta
10/23/2024 02:32 AM
@prajakta can you share prov logs?
10/23/2024 03:17 AM
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-m9725-DEBUG-Calling Webservice Url - https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}" with httpParams - null
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-m9725-DEBUG-Got Webservice API Response: [error:Error Illegal character in query at index 49: https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}"]
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-12-m9725-DEBUG-Got null response statusCode with erroMsg - [error:Error Illegal character in query at index 49: https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}"]
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-m9725-DEBUG-addAccessJSON: [call:[[name:Groups, connection:userAuth, url:https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}", httpMethod:GET, httpHeaders:[Authorization:${access_token}, ConsistencyLevel:eventual], httpContentType:application/json, successResponses:[statusCode:[200]]], [name:Groups, connection:userAuth, url:https://graph.microsoft.com/v1.0/groups/${entitlementValue.entitlementID}/members/\$ref, httpParams:{"@odata.id":"https://graph.microsoft.com/v1.0/directoryObjects/${response.Groups.message.value[0].id}"}, httpMethod:POST, httpHeaders:[Authorization:${access_token}], httpContentType:application/json, successResponses:[statusCode:[200]]]]]
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-m9725-DEBUG-params.memento.addAccessJSON : [call:[[name:Groups, connection:userAuth, url:https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}", httpMethod:GET, httpHeaders:[Authorization:${access_token}, ConsistencyLevel:eventual], httpContentType:application/json, successResponses:[statusCode:[200]]], [name:Groups, connection:userAuth, url:https://graph.microsoft.com/v1.0/groups/${entitlementValue.entitlementID}/members/\$ref, httpParams:{"@odata.id":"https://graph.microsoft.com/v1.0/directoryObjects/${response.Groups.message.value[0].id}"}, httpMethod:POST, httpHeaders:[Authorization:${access_token}], httpContentType:application/json, successResponses:[statusCode:[200]]]]]
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-m9725-DEBUG-currentEntitlementJsonMap : [call:[[name:Groups, connection:userAuth, url:https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}", httpMethod:GET, httpHeaders:[Authorization:${access_token}, ConsistencyLevel:eventual], httpContentType:application/json, successResponses:[statusCode:[200]]], [name:Groups, connection:userAuth, url:https://graph.microsoft.com/v1.0/groups/${entitlementValue.entitlementID}/members/\$ref, httpParams:{"@odata.id":"https://graph.microsoft.com/v1.0/directoryObjects/${response.Groups.message.value[0].id}"}, httpMethod:POST, httpHeaders:[Authorization:${access_token}], httpContentType:application/json, successResponses:[statusCode:[200]]]]] | entitlementname: Groups
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-m9725-DEBUG-currentEntitlementJsonMap : [call:[[name:Groups1, connection:userAuth, url:https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}", httpMethod:GET, httpHeaders:[Authorization:${access_token}, ConsistencyLevel:eventual], httpContentType:application/json, successResponses:[statusCode:[200]]], [name:Groups2, connection:userAuth, url:https://graph.microsoft.com/v1.0/groups/${entitlementValue.entitlementID}/members/\$ref, httpParams:{"@odata.id":"https://graph.microsoft.com/v1.0/directoryObjects/${response.Groups.message.value[0].id}"}, httpMethod:POST, httpHeaders:[Authorization:${access_token}], httpContentType:application/json, successResponses:[statusCode:[200]]]]]
2024-10-23T14:19:02+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-m9725-DEBUG-params.memento.addAccessJSON: [call:[[name:Groups1, connection:userAuth, url:https://graph.microsoft.com/beta/devices?$search="displayName:${account.accountID}", httpMethod:GET, httpHeaders:[Authorization:${access_token}, ConsistencyLevel:eventual], httpContentType:application/json, successResponses:[statusCode:[200]]], [name:Groups2, connection:userAuth, url:https://graph.microsoft.com/v1.0/groups/${entitlementValue.entitlementID}/members/\$ref, httpParams:{"@odata.id":"https://graph.microsoft.com/v1.0/directoryObjects/${response.Groups.message.value[0].id}"}, httpMethod:POST, httpHeaders:[Authorization:${access_token}], httpContentType:application/json, successResponses:[statusCode:[200]]]]]
10/23/2024 03:25 AM
Try this @prajakta
url:https://graph.microsoft.com/beta/devices?$search=\"displayName%3A${account.accountID}\",
10/23/2024 03:40 AM
Appreciate your quick response. Getting similar error for
"url": "https://graph.microsoft.com/beta/devices?$search=\"displayName%3A${account.accountID}\"",