Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/21/2024 04:11 AM
Hi,
i am trying to create a new account with REST connector by using the below JSON.
{
"accountIdPath": "call1.message.user[0].userName",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://https://xyz.com/profile/v4/Users ",
"httpMethod": "POST",
"httpParams": "{\"user\":[{\"email\": \"${user.email}\",\"userName\":\"${user.userName}\",\"FIRST_NAME\": \"${user.firstname}\",\"LAST_NAME\": \"${user.lastname}\",\"ORG_UNIT_4\":\"US\",\"ORG_UNIT_2\": \"E0119\",\"ORG_UNIT_1\": \"(001)001-US Tech\",\"lEDGER_KEY\": \"LEDGER\",\"Custom21\":\"US\",\"employeeNumber\":\"${user.email}\",\"Custom20\": \"(001)001-US Tech\",\"path\": \"urn:ietf:params:scim:schemas:extension:spend:2.0:Role:roles\",\"value\": [{\"roleName\": \"EXP_USER\"},{\"roleName\": \"EXP_APPROVER\"},{\"roleName\": \"STATEMENT_APPROVER\"},{\"roleName\": \"STATEMENT_USER\"}]}]}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
500,
501,
502,
503,
504
]
}
}
]
}
The new and add access task are getting created .
I am getting the below error for new account task.
I am not getting the error if its related to a specific attribute or something else. ? Has anyone faces this kind of error for REST.
05/22/2024 08:41 PM - edited 05/22/2024 08:44 PM
Helloo @Rajatlm10,
Please try with the below json, variable for the username was wrong.
{
"accountIdPath": "call1.message.user[0].username",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://https://xyz.com/profile/v4/Users ",
"httpMethod": "POST",
"httpParams": "{\"user\":[{\"email\": \"${user.email}\",\"userName\":\"${user.username}\",\"FIRST_NAME\": \"${user.firstname}\",\"LAST_NAME\": \"${user.lastname}\",\"ORG_UNIT_4\":\"US\",\"ORG_UNIT_2\": \"E0119\",\"ORG_UNIT_1\": \"(001)001-US Tech\",\"lEDGER_KEY\": \"LEDGER\",\"Custom21\":\"US\",\"employeeNumber\":\"${user.email}\",\"Custom20\": \"(001)001-US Tech\",\"path\": \"urn:ietf:params:scim:schemas:extension:spend:2.0:Role:roles\",\"value\": [{\"roleName\": \"EXP_USER\"},{\"roleName\": \"EXP_APPROVER\"},{\"roleName\": \"STATEMENT_APPROVER\"},{\"roleName\": \"STATEMENT_USER\"}]}]}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
500,
501,
502,
503,
504
]
}
}
]
}
Thanks.
05/23/2024 02:27 AM
Hey @sudeshjaiswal thnx for the reply,
i used the JSON you provided but i am still getting the same error.
05/22/2024 09:15 PM
Does connection is successful ? as error is 401
05/23/2024 02:29 AM
Hey @rushikeshvartak its says connection successfull when i do test connection. Nothing specific comes in logs.
Also, with same parameters i am testing in postman and its working fine there.
05/23/2024 07:32 AM
Hello @Rajatlm10,
Please add testconnectionparams in your connectionjson and test if the connection is successfull.
For Ref :- https://docs.saviyntcloud.com/bundle/Dev-Handbook-REST-v24x/page/Content/Developers-Handbook.htm
Thanks
05/23/2024 09:25 PM