Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Is Saviynt currently supporting user object to Handle response for Rest Connection?

chetan_falke
New Contributor
New Contributor
I am refering Rest Connection document (https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm) and want to handle response "DuplicateResourceException" so that task will not move in error and user will create in IAM if its already available in Target side.
 
I tried using below message in  Create account JSON 
 
"responseMessage": "There was an error creating user: An error occurred (DuplicateResourceException) when calling the CreateUser operation: A user with username ${user.custompropertyXX} already exists in Amazon Connect"
 
Note : tried with Accountname and ID as well.
 
Sample API response 
call1":{"headers":null,"message":{"responseMessage":"\"There was an error creating user: An error occurred (DuplicateResourceException) when calling the CreateUser operation: A user with username test.last@xxx.com.au already exists in Amazon Connect\"\n"},"statusCode":500,"description":null,"status":"Failed"}
 
 
Kindly suggest. How to handle this scenario.
3 REPLIES 3

rushikeshvartak
All-Star
All-Star

Please share full json


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak ,

The JSON is as below for  Create account JSON

{
"accountIdPath": "accountName",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://XXXapi/v1/user/create",
"httpMethod": "POST",
"httpParams": "{\"connect_instance_name\": \"retail_dr\", \"user_id\": \"${user.customproperty47}\", \"first_name\": \"${user.firstname}\", \"last_name\": \"${user.lastname}\", \"routing_profile\": \"saviynt-basicqueue-default\", \"security_profiles\": [\"s-Agent\"],\"auto_accept\" :\"no\", \"after_work_timeout\" : ${requestAccessAttributes.get('acw-timeout')!=null?requestAccessAttributes.get('acw-timeout'):0}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
],
"responseMessage": "There was an error creating user: An error occurred (DuplicateResourceException) when calling the CreateUser operation: A user with username ${user.customproperty47} already exists in Amazon Connect"
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405,
500,
"Unauthorized"
],
"responseMessage": "Error 401: Bad credentials"
}
}
]
}

Hi @rushikeshvartak ,

Please provide your suggestion and let me know if you need more information.

Thanks,