Skip to main content
Question

Using SCIM Api how can I replace the mobile phone number?

  • 17 September 2020
  • 2 replies
  • 1231 views

curl --request PATCH   --url https://platform.devtest.ringcentral.com/scim/v2/Users/283100004   --header 'accept: application/json'   --header 'authorization: Bearer xxx'   --header 'content-type: application/json'   --data '{"Operations":[{"op":"replace","path":"phoneNumbers/1/mobile","value":"+491713334445"}],"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"]}'

Above is my request, but it does not work because the path variable is set wrong.
As you know the phoneNumbers field is an array of objects, identified by the type. If I want to replace it with a different number, what does the patch operation have to look like?
"phoneNumbers": [ { "value": "+491713334445", "type": "mobile" } ]

2 replies

Userlevel 2
Badge

Here is the sample body:

var body = {
      schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
      Operations:[
          {
            op:"replace",
            path: "phoneNumbers[type eq "mobile"].value",
            value: "+491713334445"
          }
        ]
      }


Perfect, thank you. I could not find the correct syntax for the "path" value.

Reply