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

REST Connector success message configuration

SSinha_
New Contributor III
New Contributor III

Hi team, 

I need to configure a response message from the update account API call as successfull so if that error comes the task is automatically completed. 

below is the error response message which I need to pass it in the "success" parameter in json

{"auditDetails":{"call1":[{"headers":null,"message":{"responseMessage":"A record with this combination of values already exists."},"statusCode":400,"description":null,"status":"Failed"},{"headers":null,"message":{"responseMessage":"A record with this combination of values already exists."},"statusCode":400,"description":null,"status":"Failed"}

 

Here is the json I am using but it is not working, as you can see I passing the response in the "message" parameter

{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "sampleurl",
"httpMethod": "POST",
"httpParams": "{\"SecurityContext\":\"Data access set\",\"SecurityContextValue\":\"${requestAccessAttributes?.get('SecurityContextProv')}\",\"RoleNameCr\":\"${requestAccessAttributes?.get('JobRole')}\",\"UserName\":\"${user.username}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/vnd.oracle.adf.resourceitem+json",
"successResponses": {
"message": "A record with this combination of values already exists.",
"statusCode": [
201,
200,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
501,
500
]
}
}
]
}

8 REPLIES 8

rushikeshvartak
All-Star
All-Star

 

{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "sampleurl",
"httpMethod": "POST",
"httpParams": "{\"SecurityContext\":\"Data access set\",\"SecurityContextValue\":\"${requestAccessAttributes?.get('SecurityContextProv')}\",\"RoleNameCr\":\"${requestAccessAttributes?.get('JobRole')}\",\"UserName\":\"${user.username}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/vnd.oracle.adf.resourceitem+json",
"successResponses": [
{
"statusCode": 202
},
{
"responsePath": "auditDetails.call1.message.responseMessage",
"values": ["A record with this combination of values already exists."]
}
],
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
501,
500
]
}
}
]
}

Refer https://forums.saviynt.com/t5/identity-governance/successresponses-for-rest-connection-are-failing/m...


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

Thank you for the response , but it is still not working and the task is in pending state only

SSinha_
New Contributor III
New Contributor III

There is a similar ticket but no solution in this one as well 

Define success for API call based on message recei... - Saviynt Forums - 51977

SSinha_
New Contributor III
New Contributor III

@rushikeshvartak Thank you for the response , but the task is still pending with the same error

Vedanth-BK
Regular Contributor
Regular Contributor

Hello @SSinha_ 

Please try with the below JSON

{
  "call": [
    {
      "name": "call1",
      "connection": "acctAuth",
      "url": "sampleurl",
      "httpMethod": "POST",
      "httpParams": "{\"SecurityContext\":\"Data access set\",\"SecurityContextValue\":\"${requestAccessAttributes?.get('SecurityContextProv')}\",\"RoleNameCr\":\"${requestAccessAttributes?.get('JobRole')}\",\"UserName\":\"${user.username}\"}",
      "httpHeaders": {
        "Authorization": "${access_token}"
      },
      "httpContentType": "application/vnd.oracle.adf.resourceitem+json",
      "successResponses": {
        "message.responseMessage": "A record with this combination of values already exists.",
        "statusCode": [
          201,
          200,
          204
        ]
      }
    }
  ]
}
Thank you
Vedanth B.K

SSinha_
New Contributor III
New Contributor III

@Vedanth-BK Tried the json, the task is still in pending state

Vedanth-BK
Regular Contributor
Regular Contributor

@SSinha_ Please share the provisioning comments 

Thank you
Vedanth B.K

SSinha_
New Contributor III
New Contributor III

{"auditDetails":{"call1":[{"headers":null,"message":{"responseMessage":"A record with this combination of values already exists."},"statusCode":400,"description":null,"status":"Failed"},{"headers":null,"message":{"responseMessage":"A record with this combination of values already exists."},"statusCode":400,"description":null,"status":"Failed"}