question

Naveen Mula avatar image
Naveen Mula asked Paul Rarey edited

How do I create an extension and role for an user with API?

I am trying to create an extension for the user with passing roles in the json body. But I am getting errors saying roles parameter is not valid. I am using string and role id. Can you let us know how this API works? Wihtout passing roles I am able to create extension

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

First of all, the roles param is optional and I believe the default value is the "Standard User". The roles param is an array of object which has the "id" and "uri", which are internal values. For some reason we have no public API to query roles so it seems you can't define the roles param when creating an extension using API.

Please submit a support ticket to ask for accessing the read roles API. Please mention me on your request so I can talk to the support engineer.

+ Phong Vu

1 |3000

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

Anirban avatar image
Anirban answered

Just to add, as you can go through the API documentation here

https://developers.ringcentral.com/api-reference/Extensions/createExtension

As already mentioned in previous answer, roles param is optional so that's the reason you are able to create extension without issue. Please go the document carefully, you can get details of the API and each parameter description. You can even test you API here.

1 |3000

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

Eric Olsen avatar image
Eric Olsen answered

@Anirban That doesn't answer OP's original question about if a role can be assigned via API. While yes, the role parameter is optional, as you stated, OP is requesting to know how to change the role if necessary/desired.

1 |3000

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

Paul Rarey avatar image
Paul Rarey answered Paul Rarey edited

@eric-olsen

It appears to assign/change a user's Role the Role Management APIs need to be used.

Any Role in the Account's inventory can be set as the Default Role. That implies all new users/extensions created will get that Role. I haven't seen where an existing Role can be specified in any of the Provisioning APIs (Extensions nor SCIM).

1 |3000

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

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