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

Create JSON for InContact UserHub

SowmithriV
Regular Contributor
Regular Contributor

PostMan call for Invite User to the InContact Application is as follows

Screenshot 2024-02-13 at 10.55.33 PM.png

Tried adding this to the CreateAccount JSON Call 2 and getting the following error.
Task Response: {"call1":{"headers":"","message":{"success":true,"uuid":"11eeca92-79f1-3170-8427-0242ac110004","msg":"User created on Evolve"},"statusCode":200,"description":null,"status":"Success"},"call2":{"message":"Unexpected character ('1' (code 49)): was expecting comma to separate Object entries\n at [Source: {\"inviteUserIds\": \"[\"11eeca92-79f1-3170-8427-0242ac110004\"]\",\"senderUserId\": \"11ee7e46-55e9-56b0-876a-0242ac110003\"}; line: 1, column: 23]","status":"Failed"}}.

Attaching the JSON for reference. Kindly let me know what I'm doing wrong.

 

{
    "accountIdPath": "call1.message.uuid",
    "call": [
        {
            "name": "call1",
            "connection": "acctAuth",
            "showResponse": true,
            "url": "https://xyz/user-management/v1/users",
            "httpMethod": "POST",
            "httpParams": "{\"firstName\":\"${user.preferedFirstName}\",\"lastName\":\"${user.customproperty2}\",\"externalIdentity\":\"${user.email}\",\"emailAddress\":\"${user.email}\",\"role\":\"${user.customproperty15}\",\"teamid\":\"${user.customproperty17}\",\"country\":\"${user.country}\",\"hireDate\":\"${user.startdate.toString().substring(0,10)}\"}",
            "httpHeaders": {
                "Authorization": "${access_token}",
                "Accept": "application/json"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200,
                    201
                ]
            }
        },
        {
            "name": "call2",
            "connection": "acctAuth",
            "showResponse": true,
            "url": "https://xyz/user-management/v1/users/invite",
            "httpMethod": "POST",
            "httpParams": "{\"inviteUserIds\": \"[\"${response.call1.message.uuid}\"]\",\"senderUserId\": \"11ee7e46-55e9-56b0-876a-0242ac110003\"}",
            "httpHeaders": {
                "Authorization": "${access_token}",
                "Accept": "application/json"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200,
                    201
                ]
            }
        }
    ]
}

 

2 REPLIES 2

AmitM
Valued Contributor
Valued Contributor

HI @SowmithriV , just a guess , can you try :

"httpParams": "{\"inviteUserIds\": \"${response.call1.message.uuid}\",\"senderUserId\": \"11ee7e46-55e9-56b0-876a-0242ac110003\"}"

Please enable showLogs true in config json and share logs if this doesn't work.

Thanks, Amit

If helped, please ACCEPT SOLUTION to close thread and for others to know that it worked.

SowmithriV
Regular Contributor
Regular Contributor

Thanks for the input @AmitM. The tricky part was to represent the userID in array [] with valid JSON syntax. I was able to figure it out myself. 

Below Syntax worked for me,

"httpParams": "{\"inviteUserIds\": [\"${response.call1.message.uuid}\"],\"senderUserId\": \"11ee7e46-55e9-56b0-876a-0242ac110003\"}",