Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

REST Connector new account.

Rajatlm10
New Contributor III
New Contributor III

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. 

Rajatlm10_0-1716289818727.pngRajatlm10_1-1716289838496.png

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. 

6 REPLIES 6

sudeshjaiswal
Saviynt Employee
Saviynt Employee

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.

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Hey @sudeshjaiswal  thnx for the reply, 

i used the JSON you provided but i am still getting the same error. 

 

rushikeshvartak
All-Star
All-Star

Does connection is successful ? as error is 401


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

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. 

 

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

If you find the above response useful, Kindly Mark it as "Accept As Solution".


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.