cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
528
Views
0
Helpful
7
Replies

Cannot unassign primary phone number with Webex API - people

Using PUT https://webexapis.com/v1/people/{id}  I cannot remove the user's phone number and set it to null.

When I have the following in the body:

{
     "phoneNumbers"[
 {
     "type""work"
      "value""none"
 }
]
}
 
The response comes back with the number unchanged. Setting it to null is the same as well. This is also with setting the "extension" key to 00000.
 
Is it not possible to set a user to have no number and extension with the API?
1 Accepted Solution

Okay, that's little odd to hear! I wasn't expecting to behave it in such manner though.
Anyway, in that case - may I ask you to try with the SCIM v2 /users API once please!
Here is the API page - https://developer.webex.com/docs/api/v1/scim2-user/update-a-user-with-put

You can try with either below 'phoneNumber[]' payload - 

"phoneNumbers": [{
      "value": "",
      "type": "work",
      "display": "",
      "primary": false
}]

or, you can also try to keep it as just a blank array, like - 

"phoneNumbers": []

I'm asking to test it with SCIM API because in long run, we're only going to keep the SCIM API and there is a discussion on the table to deprecate the /people API anyway since there are certain hiccups with it.

Let us know how it works with the SCIM API, and in case if you face the same problem, we can check it further through a developer Support case.

Regards!
Sandip

View solution in original post

7 Replies 7

ross.millan
Level 1
Level 1

I'm just wondering if you haven't included ALL of the information in your body.  The People API says:

"Include all details for the person. This action expects all user details to be present in the request. A common approach is to first GET the person's details, make changes, then PUT both the changed and unchanged values."

I had a similar problem using the developer portal trying to update a mobile phone number to blank a while back.  In the end Cisco's suggestion was to use Postman to do a get and then copy paste all the fields, and then update the mobile phone number to a blank string with:

"mobilePhoneNumber": ""

 

Hi @isthisthethirdroom,
Thanks for sharing the details!
Could you kindly send the details to devsupport@webex.com and we can start discussing this with Engg. about it.
I'm asking to send a email to our Dev Support Email thread because that would raise a Support case in our queue and that way it's better to track a discussion rather than community forum.

Please mention in the email, that this below payload for "phoneNumbers" request parameter - 

"phoneNumbers": [
{
"type": "work",
"value": ""
}
],

in the API - https://webexapis.com/v1/people/{id} works for users without Webex Calling - Professional licenses. For users with the Professional license their number and extension remained unchanged. Please mention this.
Also if possible, could you kindly share a API Request "trackingId" where for Users with Webex Calling - Professional licenses, phone number is remaining unchanged?
Since it's not erroring out, you won't get the trackingId from developer portal. You've to make the request from POSTMAN and in the POSTMAN Response - Headers() section, there you'll find the trackingId.

And regarding the SCIM API, if you just use your own token rather than OAuth token - then how does it go.
Are you performing this API request as a Partner Admin?
Asking because otherwise this "identity:people_rw" scope won't be so important!

But anyway, let's check first for the usual /users API and as mentioned above, try it from POSTMAN for Licensed Calling Users, let us know through that Dev Support Email how it goes.

Regards!
Sandip

sandiban
Cisco Employee
Cisco Employee

Hi @isthisthethirdroom,

Thanks for your patience so far!
Yes, it should be doable through the API you're using, but for the "phoneNumbers[]" request parameter, the values provided in it should be little different.
Please follow the below payload in "phoneNumbers[]" - 

"phoneNumbers": [
{
"type": "work",
"value": ""
}
],

For "value", in place of "none", kindly place it as "" (blank). This should work.
Let us know how it goes. 

Regards!
Sandip

Please Note: If you think the solution provided above was helpful and satisfactory, please accept it as a Solution! However if you want to discuss it further and get yourself unblocked, please don't hesitate to reply back on this thread and we'll try to answer those queries by the soonest. In that case, once all of your queries are cleared - finally you can mark it as "Accepted as Solution"

Thank you @sandiban.

This solution worked, but only for users without Webex Calling - Professional licenses. For users with the Professional license their number and extension remained unchanged. The only workaround using the API that I've been able to make work is to remove their Professional license and then re-add it with another call using the parameters that you provided.

If there is a way to remove numbers from users with Webex Calling - Professional licenses with the API please let me know.

Okay, that's little odd to hear! I wasn't expecting to behave it in such manner though.
Anyway, in that case - may I ask you to try with the SCIM v2 /users API once please!
Here is the API page - https://developer.webex.com/docs/api/v1/scim2-user/update-a-user-with-put

You can try with either below 'phoneNumber[]' payload - 

"phoneNumbers": [{
      "value": "",
      "type": "work",
      "display": "",
      "primary": false
}]

or, you can also try to keep it as just a blank array, like - 

"phoneNumbers": []

I'm asking to test it with SCIM API because in long run, we're only going to keep the SCIM API and there is a discussion on the table to deprecate the /people API anyway since there are certain hiccups with it.

Let us know how it works with the SCIM API, and in case if you face the same problem, we can check it further through a developer Support case.

Regards!
Sandip

@sandibanI was finally able to get the SCIM Users API to work. Once again though, without removing the license, phone numbers aren't removed from the user. If I do another GET call, the phone numbers aren't there, but if I look in the GUI the user still has the number and extension configured. Moving forward I will just remove the license to remove the phone number. If the people API is removed, then licenses need to be shown on SCIM Users. Otherwise there will be no way to see what licenses a user has.

On another note, the API documentation could use a lot of clarification. For anybody who comes across this looking for answers...

The Org Id that needs to be used for the API call is the Org ID that is at the end of your personal bearer token. It IS NOT the Org ID that comes back if you use the Organizations API call, the Org ID found anywhere in the Webex GUI, or the Org ID that is found on an integration or service app in the developer portal. Even though this Org ID can be used as a parameter in other API calls. The only way I was able to figure this out was through a colleague who had a similar issue before. In the same vein, user IDs that are retrieved through non-SCIM API calls are not valid for the SCIM APIs. You have to search SCIM users and then use that ID. Kind of a pain to have different user IDs for different API calls.

Also, the API documentation says an OAuth authorization flow is required for the API. After abandoning using my service app token and learning how to integrate OAuth into my application (which was a less than ideal solution), I found out that a personal token or service app token does indeed work with the SCIM APIs.

Thank you for your patience and helping me thorough this sandiban.

Unfortunately I'm getting a 403 error any time I try to use the SCIM 2 Users APIs. I use OAuth with the identity:people_rw scope and my user account is a full site administrator. I even added the specific User Administrator ID to my roles through the API. I can use other API calls using the same OAuth workflow with appropriate scopes, but no matter what I do I cannot get the SCIM API calls to work.

Below is the response I get if it's of any help:

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error",
    "urn:scim:schemas:extension:cisco:webexidentity:api:messages:2.0:Error"
  ],
  "status": "403",
  "urn:scim:schemas:extension:cisco:webexidentity:api:messages:2.0:Error": {
    "trackingId": "WEBEX-DEV-PORTAL_a1d9c79f-7369-4bc8-a858-c48085e0871e_3",
    "errorCode": "200003",
    "details": "Sorry, you don't have sufficient privileges"
  }
}

 Any help is appreciated.