question

Gary Weissenbacher avatar image
Gary Weissenbacher asked Phong Vu commented

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

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" } ]

rest api
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered Gary Weissenbacher commented

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"
          }
        ]
      }


1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Gary Weissenbacher avatar image Gary Weissenbacher commented ·

Works!

0 Likes 0 ·
Gary Weissenbacher avatar image
Gary Weissenbacher answered Phong Vu commented

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

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image Phong Vu ♦♦ commented ·
0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys