akshunds | 2020-11-05 14:37:24 UTC | #1
Hi there.
I am trying to make a patch request using the SCIM API. In this instance I'm trying to remove the current users "Title", but nothing is happening. I'm very unsure on how to use this api. I have a feeling there is something wrong in how I'm using the schema and/or path.
List<string> schemaList = new List<string>(); string patchOpSchema = "urn:ietf:params:scim:api:messages:2.0:PatchOp"; schemaList.Add(patchOpSchema);
ScimV2PatchOperation patchOperation = new ScimV2PatchOperation(); patchOperation.Op = ScimV2PatchOperation.OpEnum.Remove; patchOperation.Path = "Title";
List<ScimV2PatchOperation> patchOperationList = new List<ScimV2PatchOperation>(); patchOperationList.Add(patchOperation);
ScimV2PatchRequest request = new ScimV2PatchRequest(Schemas: schemaList, patchOperationList); scimApi.PatchScimV2User(ID, body: request);
Also, I don't understand how to use the JsonNode type if I want to replace or create a new attribute. I suspect this is where I would put the value of the new attribute, but I cant find any option to input a string as the new value
Thanks
anon11147534 | 2020-10-28 17:52:17 UTC | #2
What response or exception are you getting from PatchScimV2User ?
I'm not familiar with this API but I imagine the Path is case sensitive so you could try "title" as the value.
Greg_Cunningham | 2020-10-28 18:50:57 UTC | #3
The value attribute is a pretty complex and swagger and API documentation are not sufficient for describing all of the possibilities. The best source for understanding the SCIM patch is the RFC. https://tools.ietf.org/html/rfc7644#section-3.5.2. Here is an example of patch of user: { "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations":[ { "op":"replace", "path": "phoneNumbers[type eq \"work\"].value", "value": "+13177023406" }, { "op":"add", "path":"externalId", "value": "--campaignUser0@example.com" } ] }
Here is an example of a patch of Group membership: { "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations":[ { "op":"add", "path": "members", "value": [ { "value": "d2ac184e-4733-41e9-8a45-3459e1efd8c7" } ] } ] } So a value could be a an array, or a value. It's type is dependent on the target type.
akshunds | 2020-10-29 03:38:07 UTC | #4
Alright. I have looked at https://tools.ietf.org/html/rfc7644#section-3.5.2 already. But I was wondering if I can modify a user, using the PATCH /api/v2/scim/v2/users/{userId} endpoint from the SCIM Api from https://developer.mypurecloud.com/api/rest/v2/scim/index.html. It seems the "Value" attribute only takes an object of type "JsonNode" which does not have any options for defining a new value
system | 2020-11-29 03:38:10 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 9167