Skip to main content
The First Step
Sep 17, 2020 7:51 AM UTC
Question

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

    2 replies

    PhongVu
    Community Manager
    Community Manager
    Sep 17, 2020 8:09 PM UTC

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


    The First Step
    Sep 18, 2020 6:48 AM UTC

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