Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/17/2024 04:15 AM
Dear Experts,
In my REST connector, the SCIM PATCH call for update account is not working.
Same call in postman with same payload is working.
UpdateAccountJSON--------------------------------------------
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/v2/Users/${account.accountID}",
"httpMethod": "PATCH",
"httpParams": "{\"schemas\": [\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\": [{\"op\": \"replace\",\"path\": \"urn:ietf:params:scim:schemas:core:2.0:User:name.givenName\",\"value\": \"${user.firstname}\"},{\"op\": \"replace\",\"path\": \"urn:ietf:params:scim:schemas:core:2.0:User:name.familyName\",\"value\": \"${user.lastname}\"},{\"op\": \"replace\",\"path\": \"emails\",\"value\": [{\"value\": \"${user.email}\"}]}]}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"successResponses": {
"statusCode": [
200
]
}
}
]
}
-------------------------------------------------------------------------------------
postman:
-----------------------------------------------------
error coming in task :
{
"auditDetails": {
"call1": [
{
"headers": null,
"message": {
"status": "error",
"message": "Error while parsing data.(SyntaxError: Unexpected token 'u', \"[urn:ietf:p\"... is not valid JSON)"
},
"statusCode": 400,
"description": null,
"status": "Failed"
}
]
},
"call1": {
"headers": null,
"message": {
"status": "error",
"message": "Error while parsing data.(SyntaxError: Unexpected token 'u', \"[urn:ietf:p\"... is not valid JSON)"
},
"statusCode": 400,
"description": null,
"status": "Failed"
}
}
Will appreciate any help.
thanks in advance
Partha
09/17/2024 05:53 AM
Please share full logs in text format
09/17/2024 06:11 AM
09/17/2024 10:43 AM
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/v2/Users/${account.accountID}",
"httpMethod": "PATCH",
"httpParams": "{\"schemas\": [\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\": [{\"op\": \"replace\",\"path\": \"urn:ietf:params:scim:schemas:core:2.0:User:name.givenName\",\"value\": \"${user.firstname}\"},{\"op\": \"replace\",\"path\": \"urn:ietf:params:scim:schemas:core:2.0:User:name.familyName\",\"value\": \"${user.lastname}\"},{\"op\": \"replace\",\"path\": \"emails\",\"value\": [{\"value\": \"${user.email}\"}]}]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"successResponses": {
"statusCode": [200]
}
}
]
}
09/18/2024 12:36 AM
No luck Rushi,
09/18/2024 05:04 AM
Share postman body as text and also try with hardcoded value once to narrow down issue
09/18/2024 07:04 AM
Here is the postman body: Working
09/18/2024 07:05 AM
Check with app team when above error occurs
09/18/2024 09:50 AM
But surprisingly postman call works fine with response 200
here is the postman req and response
curl --location --request PATCH 'https://xxxxxxxxxxxxxxxxxxx/scim/v2/Users/14' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \ --data-raw '{ "schemas": [ "urn:ietf:params:scim:api:messages:2.0:PatchOp" ], "Operations": [ { "op": "replace", "path": "urn:ietf:params:scim:schemas:core:2.0:User:name.givenName", "value": "Arbnore-updated" }, { "op": "replace", "path": "urn:ietf:params:scim:schemas:core:2.0:User:name.familyName", "value": "Areia Castro updated" }, { "op": "replace", "path": "emails", "value": [ { "value": testg.updated1@mgc.vh } ] } ] }' |
{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ], "id": 14, "userName": "M9004422", "name": { "givenName": "Arbnore-updated", "familyName": "Areia Castro updated" }, "emails": [ { "value": testg.updated1@mgc.vh } ], "externalId": null, "active": true, "meta": { "resourceType": "User", "location": https://xxxxxxxxxxxxxxxxxxxxxxxx/scim/v2/Users/14, "lastModified": "2024-09-18T16:40:48.090Z", "created": "2024-09-16T09:14:44.947Z" }, "roles": [ { "value": "{\"value\": \"New Group 1\"}" } ] } |
I have checked with hardcoded value, but that doesnt work either.
09/18/2024 09:56 AM
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxx/scim/v2/Users/14",
"httpMethod": "PATCH",
"httpParams": "{\"schemas\": [\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\": [{\"op\": \"replace\",\"path\": \"urn:ietf:params:scim:schemas:core:2.0:User:name.givenName\",\"value\": \"${user.firstname}\"},{\"op\": \"replace\",\"path\": \"urn:ietf:params:scim:schemas:core:2.0:User:name.familyName\",\"value\": \"${user.lastname}\"},{\"op\": \"replace\",\"path\": \"emails\",\"value\": [{\"value\": \"${user.email}\"}]}]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/scim+json"
},
"successResponses": {
"statusCode": [200]
}
}
]
}
09/18/2024 10:08 AM
Hi Rushi,
already tried.
"Content-Type": "application/scim+json" and "Content-Type": "application/json" doesnt manke any difference. Thanks.
09/18/2024 10:11 AM
Share latest logs in text format
09/19/2024 12:23 AM
09/27/2024 02:34 AM
Hi All,
As mentioned by the Saviynt Office hours, I confirm that the Create operation is working fine which is a PUT call.
below is the JSON for Create account
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxxxxxxxxxxxx/scim/v2/Users",
"httpMethod": "POST",
"httpParams": "{\"schemas\": [\"urn:ietf:params:scim:schemas:core:2.0:User\"],\"userName\": \"${user.username}\",\"active\": ${user.statuskey == 1?true:false},\"emails\": [{\"primary\": true,\"type\": \"work\",\"value\": \"${user.email}\"}],\"meta\": {\"resourceType\": \"User\"},\"name\": {\"formatted\": \"${user.displayname}\",\"familyName\": \"${user.lastname}\",\"givenName\": \"${user.firstname}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
],
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {}
}
09/27/2024 02:38 AM
So your http method was wrong POST instead of PATCH
09/27/2024 03:00 AM
No Rushi,
Create call in POST - working
Update, ADDaccess, remove access are PATCH - not working
09/27/2024 03:03 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.‼️‼️⚠️
09/27/2024 03:01 AM
this is the error for Update call
"call1": {
"headers": null,
"message": {
"status": "error",
"message": "An unexpected error occurred -2- please contact support for assistance."
},
"statusCode": 500,
"description": null,
"status": "Failed"
}