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

Not able to get username in ChangePassJSON in REST connector

vermark
Regular Contributor
Regular Contributor

Hi Team,

We are using below ChangePassJSON in REST connector. When this json is called it is not able to evaluate the value for variable ${user?.username}

Error we are geting "User Does not exist". Please assist.

{
"accountIdPath": "call1.message.AccountID",
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https://localhost.saviyntcloud.com/ECM/api/v5/changePassword",
"httpMethod": "POST",
"httpParams": "{\"username\":\"${user?.username}\",\"password\":\"${task?.password}\",\"changePasswordAssociatedAccounts\":\"true\",\"endpoint\":\"[Xstore]\",\"validateagainstpolicy\":\"N\"}",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201]
}
}]
}

4 REPLIES 4

nimitdave
Saviynt Employee
Saviynt Employee

${user.username} should work. But just to isolate the issue, if you try to pass the only user name as hardcoded value in the above json instead of expression does that work?

vermark
Regular Contributor
Regular Contributor

Yes, with hardcoded value in username it works fine.

I tried following variable but none of them works.

${user.username}

${users.username}

${user?.username}

${users?.username}

${username}

timchengappa
Saviynt Employee
Saviynt Employee

Hi @vermark, as @nimitdave mentioned ${user.username} is the correct syntax.

Can you try the below JSON to see if it resolves your issues? I noticed that you are using "${task?.password}" while we should be using "${password}" instead.
{
  "call": [
    {
      "name": "call1",
      "connection": "acctAuth",
      "url": "https://localhost.saviyntcloud.com/ECM/api/v5/changePassword",
      "httpMethod": "POST",
      "httpParams": "{\"username\":\"${user.username}\",\"password\":\"${password}\",\"changePasswordAssociatedAccounts\":\"true\",\"endpoint\":\"[Xstore]\",\"validateagainstpolicy\":\"N\"}",
      "httpHeaders": {
        "Content-Type": "application/json",
        "Authorization": "${access_token}"
      },
      "httpContentType": "application/json",
      "successResponses": {
        "statusCode": [
          200,
          201
        ]
      }
    }
  ]
}

If the issue still persists, I would recommend opening a support ticket via Freshdesk as it would require deeper triaging.

vermark
Regular Contributor
Regular Contributor

Hi Team,

Thanks for the update.

It worked with ${arsTasks.getPassword()}