Symptom
When issuing a PUT request to api/v1/scim2/Users/ID, it fails with a 400 error which states:
Request is unparsable, syntactically incorrect, or violates schema.
Environment
SAP Analytics Cloud REST API
Reproducing the Issue
- Log on to tenant using preferred API tool
- Do a GET request for the access token
- Do a GET request to User and User ID
- Attempt a PUT request using the previously acquired body from the GET request
- Observe the 400 error appear.
Cause
This is caused by a mismatch between "userName" and "idpUserID" to the USER ID in your tenant. The two values need to match in the body of your RESTFul request. Please note that the two values are case sensitive.
e.g.
This call will fail because the userName property is "TESTUSER", and the idpUserId is "testuser". To make it work you would need to make both identical.
{
"schemas": [
"urn:sap:params:scim:schemas:extension:sac:2.0:user-custom-parameters",
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "1a2b3c4d5e-f6hi-7jkl-m12n3-4567abcd1234",
"userName": "TESTUSER",
"name": {
"familyName": "test",
"givenName": "ACCESS1",
"formatted": "ACCESS1 test"
},
"displayName": "test",
"preferredLanguage": "en",
"active": true,
"emails": [
{
"value": "testuser@sap.com",
"type": "work",
"primary": true
}
],
"photos": [
{
"value": "",
"type": "photo",
"primary": true
}
],
"groups": [ ],
"roles": [
{
"value": "PROFILE:sap.epm:Admin",
"display": "Admin",
"primary": true
}
],
"urn:sap:params:scim:schemas:extension:sac:2.0:user-custom-parameters": {
"dataAccessLanguage": "en",
"systemNotificationsEmailOptIn": true,
"numberFormatting": "1,234.56",
"idpUserId": "testuser",
"timeFormatting": "H:mm:ss",
"isConcurrent": false,
"dateFormatting": "dd.MM.yyyy",
"marketingEmailOptIn": false,
"cleanUpNotificationsNumberOfDays": 0
}
}
Resolution
Please ensure your "userName" and "idpUserId" matches the USER ID in your tenant (this can be seen from the user management page).
See Also
Keywords
SAP Analytics Cloud, API, REST, GET, PUT, User, ID, Postman, Insomnia, Bruno, REST tool , KBA , LOD-ANA-ADM , SAC Administration , Problem