Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/12/2024 08:42 AM
Hi Team,
We are facing error while creating account using rest api.
ConnectionJSON:
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https:*****/oauth/token",
"httpMethod": "POST",
"httpParams": {
"grant_type": "client_credentials",
"client_secret": "*****",
"client_id": "****",
"resource": "https://*******"
},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"retryFailureStatusCode": [],
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abc"
}
}
}
CreateAccountJSON:
{
"accountIdPath": "call1.message.Id",
"call": {
"name": "call1",
"connection": "acctAuth",
"url": "https*****/api/v2/scim/users",
"httpParams": "{\"userName\": \"${user.email}\", \"active\": true, \"displayName\": \"${user.displayname}\",\"externalId\": \"${user.username}\",\"emails\": [{\"primary\": true, \"value\": \"${user.email}\", \"type\": work},{\"primary\": false, \"value\": \"${user.email}\", \"type\": other}]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
500,
501
]
}
}
}
We were able to create account using postman.
Solved! Go to Solution.
08/12/2024 08:49 AM
08/12/2024 08:50 AM
@VijayMaram is your accountIdPath mapping correct?
share the postman response
08/12/2024 09:25 AM
{
"id": "a72ae9b4-599f-4d3e-8beb-f5cb34540da39c1a",
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
"urn:ietf:params:scim:schemas:extension:genesys:purecloud:2.0:User"
],
"active": true,
"userName": "km.****@****.com",
"displayName": "km.****@****.com",
"emails": [
{
"value": "km.****@****.com",
"type": "other",
"primary": false
},
{
"value": "km.****@****.com",
"type": "work",
"primary": true
}
],
"externalId": "A77772K",
"roles": [
{
"value": "employee"
}
],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
"division": "Home"
},
"urn:ietf:params:scim:schemas:extension:genesys:purecloud:2.0:User": {
"externalIds": [
{
"authority": "x-pc:scimv2:v1:c81202d2-e4ed-4a34-8266-33b656897888c3740",
"value": "A17*****K"
}
]
},
"meta": {
"resourceType": "User",
"lastModified": "2024-08-12T15:23:38.000Z",
"location": "/api/v2/scim/v2/users/a72ae9b4-599f-4d3e-8beb-f5cb034645654da39c1a",
"version": "W/\"3\""
}
}
08/12/2024 08:54 AM
08/12/2024 09:26 AM
@rushikeshvartak
Yeah, i am using correct place. createAccountJSON.
08/12/2024 09:56 AM
{
"accountIdPath": "call1.message.Id",
"call": {
"name": "call1",
"connection": "acctAuth",
"url": "https*****/api/v2/scim/users",
"httpParams": "{\"userName\": \"${user.email}\", \"active\": true, \"displayName\": \"${user.displayname}\",\"externalId\": \"${user.username}\",\"emails\": [{\"primary\": true, \"value\": \"${user.email}\", \"type\": \"work\"},{\"primary\": false, \"value\": \"${user.email}\", \"type\": \"other\"}]}",
"httpHeaders": {
"Authorization": "Bearer ${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
500,
501
]
}
}
}
08/12/2024 10:10 AM
No Luck, getting same error.
08/12/2024 11:07 AM
Share latest logs in text file
08/12/2024 12:31 PM
08/12/2024 01:49 PM
"2024-08-12T19:23:15.895+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-3-8vmjf","ERROR","Error in createNewUser:: "
"2024-08-12T19:23:16.401+00:00","ecm-worker","","null-8vmjf","","groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.HashMap(java.util.LinkedHashMap$Entry) at com.saviynt.provisoning.rest.RestProvisioningService.createNewUser(RestProvisioningService.groovy:2696) at com.saviynt.provisoning.rest.RestProvisioningService$_createAccount_closure14.doCall(RestProvisioningService.groovy:2169) at com.saviynt.provisoning.rest.RestProvisioningService.createAccount(RestProvisioningService.groovy:2002) at com.saviynt.ecm.services.ArsTaskService.createAccountTarget(ArsTaskService.groovy:11842) at com.saviynt.ecm.services.ArsTaskHelperService$_whenTaskTypeIsThreeNewAccountAccess_closure50.doCall(ArsTaskHelperService.groovy:3078) at com.saviynt.ecm.services.ArsTaskHelperService.whenTaskTypeIsThreeNewAccountAccess(ArsTaskHelperService.groovy:3069) at com.saviynt.ecm.services.ArsTaskHelperService$_completeAutoProvTasksUpgraded_closure1.doCall(ArsTaskHelperService.groovy:175) at com.saviynt.ecm.services.ArsTaskHelperService.completeAutoProvTasksUpgraded(ArsTaskHelperService.groovy:160) at MultipleProvisioningJob.execute(MultipleProvisioningJob.groovy:222) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)"
Updated JSON
{
"accountIdPath": "call1.message.Id",
"call": {
"name": "call1",
"connection": "acctAuth",
"url": "https*****/api/v2/scim/users",
"httpParams": "{\"userName\": \"${user.email}\", \"active\": true, \"displayName\": \"${user.displayname}\",\"externalId\": \"${user.username}\",\"emails\": [{\"primary\": true, \"value\": \"${user.email}\", \"type\": \"work\"},{\"primary\": false, \"value\": \"${user.email}\", \"type\": \"other\"}]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
500,
501
]
}
}
}
If above does not works then please share screenshot from connection that JSON is added in correct location and also try with hardcoded value
08/13/2024 09:05 AM
I have tried passing same values manually, token also passed manually. Still seeing same issue.
08/13/2024 09:10 AM
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️
08/13/2024 09:19 AM
Curl information:
Response:
{
"id": "a72ae9b4-599f-4d3e-8beb-f5cb34540da39c1a",
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
"urn:ietf:params:scim:schemas:extension:genesys:purecloud:2.0:User"
],
"active": true,
"userName": "km.****@****.com",
"displayName": "km.****@****.com",
"emails": [
{
"value": "km.****@****.com",
"type": "other",
"primary": false
},
{
"value": "km.****@****.com",
"type": "work",
"primary": true
}
],
"externalId": "A77772K",
"roles": [
{
"value": "employee"
}
],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
"division": "Home"
},
"urn:ietf:params:scim:schemas:extension:genesys:purecloud:2.0:User": {
"externalIds": [
{
"authority": "x-pc:scimv2:v1:c81202d2-e4ed-4a34-8266-33b656897888c3740",
"value": "A17*****K"
}
]
},
"meta": {
"resourceType": "User",
"lastModified": "2024-08-12T15:23:38.000Z",
"location": "/api/v2/scim/v2/users/a72ae9b4-599f-4d3e-8beb-f5cb034645654da39c1a",
"version": "W/\"3\""
}
}
08/13/2024 09:27 AM
{ "accountIdPath": "call1.message.Id", "call": { "name": "call1", "connection": "acctAuth", "url": "https://api.usw2.pure.cloud/api/v2/scim/users", "httpParams": { "userName": "${user.email}", "active": true, "displayName": "${user.displayname}", "externalId": "${user.username}", "emails": [ { "primary": true, "value": "${user.email}", "type": "work" }, { "primary": false, "value": "${user.email}", "type": "other" } ] }, "httpHeaders": { "Authorization": "${access_token}", "Content-Type": "application/json" }, "httpContentType": "application/json", "httpMethod": "POST", "successResponses": { "statusCode": [ 200, 201, 204 ] }, "unsuccessResponses": { "statusCode": [ 400, 403, 401, 404, 409, 500, 501 ] }, "authError": [ "InvalidAuthenticationToken", "AuthenticationFailed" ], "errorPath": "error", "retryFailureStatusCode": [401], "timeOutError": [408], "expiryError": "token_expired", "maxRefreshTryCount": 5 } }
08/13/2024 06:28 AM
@rushikeshvartak Yes, i am using correct location. Let me try above suggestions. Will let you know results.
08/19/2024 12:27 PM
Hi @rushikeshvartak @SumathiSomala
The issue is with the connectionJSON. I have fixed it and now it's working fine.
08/19/2024 01:04 PM
Share working json to help others