Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/02/2023 11:35 AM - edited 08/02/2023 11:36 AM
HI team,
I have remove account payload which works pretty well in Postman. But when configured with Saviynt it fails with "message":{"status":"422","errors":["Invalid Object."],"message":"Invalid Object."},"statusCode":422,"description":null,"status":"Failed
Postman curl;
curl --location --request DELETE 'https://abc.domain.com/provision/users' \
--header 'access-token: xxxxx=' \
--header 'api-version: 2.0.0' \
--header 'Content-Type: text/plain' \
--data '{"EID":"cjohn023"}'
and i have configured json in saviynt as
{"call":[{"name":"call1","connection":"userAuth","url":"https://abc.domain.com/provision/users","httpMethod":"DELETE","httpParams":"{\"eid\": \"${user.username}\"}","httpHeaders":{"api-version":"2.0.0","access-token":"${access_token}","Content-Type":"text/plain"},"httpContentType":"text/plain","successResponses":{"message":"User deprovisioned successfully"}}]}
can someone let me know how do i form this json correctly.
Solved! Go to Solution.
08/02/2023 10:10 PM
Hi @nmand396 a few quick questions.
1. Are you using the above JSON in the removeAccountJSON of the connector?
2. In the postman payload, if you're passing the EID in lowercase (eid), is it still working? (just to rule out any case-sensitive issue).
08/03/2023 12:04 AM
08/04/2023 04:32 AM
Can you pass the Content type as application/json instead of plain text and try it out.
Thanks
Darshan
08/04/2023 04:35 AM
Tried. It did not work. There is something else is missing in the json
08/04/2023 04:45 AM
Try the below json and let me know what error you are getting if it fails
{
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://abc.domain.com/provision/users",
"httpMethod": "DELETE",
"httpParams": "{\"eid\": \"${user.username}\"}",
"httpHeaders": {
"api-version": "2.0.0",
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"message": "User deprovisioned successfully"
}
}]
}
Thanks
Darshan
08/04/2023 05:11 AM
Same error
2023-08-04 12:05:41,905 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - pullObjectsByRest - responseStatusCode ::422
2023-08-04 12:05:41,906 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - Entered getResponseHeaders method
2023-08-04 12:05:41,906 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - responseError : null
2023-08-04 12:05:41,906 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - isAuthError: false
2023-08-04 12:05:41,906 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - pullObjectsByRest - responseMap.size : 3
2023-08-04 12:05:41,906 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - pullObjectsByRest - objectList.size : 1
2023-08-04 12:05:41,906 [quartzScheduler_Worker-13] ERROR rest.RestProvisioningService - Call response: {"status":"422","errors":["Invalid Object."],"message":"Invalid Object."}
2023-08-04 12:05:41,907 [quartzScheduler_Worker-13] ERROR rest.RestProvisioningService - callResponseMap: [status:422, errors:[Invalid Object.], message:Invalid Object.]
2023-08-04 12:05:41,907 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - showResponse: null
2023-08-04 12:05:41,907 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - doBreak: false
2023-08-04 12:05:41,907 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - Task Response: {"auditDetails":{"call1":[{"headers":{"Keep-Alive":"timeout=5, max=100","Server":"Apache","X-Content-Type-Options":"nosniff","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,OPTIONS","Connection":"Keep-Alive","Date":"Fri, 04 Aug 2023 12:02:50 GMT","Access-Control-Allow-Headers":"Content-Type, api-version, access-token, api-token","Referrer-Policy":"origin-when-cross-origin","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cache-Control":"no-cache","Content-Security-Policy":"frame-ancestors 'self' outlook.office.com outlook.office365.com *.microsoft.com;","X-XSS-Protection":"1; mode=block","Content-Length":"146","Content-Type":"application/json"},"message":{"status":"401","errors":["The valid access-token parameter is required."],"message":"The valid access-token parameter is required.","code":30200},"statusCode":200,"description":null,"status":"Failed"}]},"call1":{"headers":{"Keep-Alive":"timeout=5, max=100","Server":"Apache","X-Content-Type-Options":"nosniff","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,OPTIONS","Connection":"Keep-Alive","Date":"Fri, 04 Aug 2023 12:05:41 GMT","Access-Control-Allow-Headers":"Content-Type, api-version, access-token, api-token","Referrer-Policy":"origin-when-cross-origin","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cache-Control":"no-cache","Content-Security-Policy":"frame-ancestors 'self' outlook.office.com outlook.office365.com *.microsoft.com;","X-XSS-Protection":"1; mode=block","Content-Length":"73","Content-Type":"application/json"},"message":{"status":"422","errors":["Invalid Object."],"message":"Invalid Object."},"statusCode":422,"description":null,"status":"Failed"}}
2023-08-04 12:05:41,908 [quartzScheduler_Worker-13] DEBUG rest.RestProvisioningService - Result: false
08/04/2023 05:20 AM
It is also saying valid access token to be passed
{"status":"401","errors":["The valid access-token parameter is required."],"message":"The valid access-token parameter is required.","code":30200},"statusCode":200,"description":null,"status":"Failed"}]},"
Can you check if you are passing the correct token as well
Thanks
Darshan
08/06/2023 05:56 PM
08/07/2023 01:59 AM
Hi @nmand396,
Analyzing the JSON and the debug logs provided above I see that the HttpMethod is DELETE and has body parameters. In such cases, the HttpMethod in the JSON needs to be DELETEWITHBODY
for more information and sample, please refer to the REST connector Guide under the developer's handbook.
Thank you
Vedanth B.K