question

Nate Breeden avatar image
Nate Breeden asked ·

Add User to Multiple Queue's

Trying to add a user to multiple queue's using the below script, my goal is not to have to make individual calls for each queue and instead make one call to add them to all necessary queues. Is this possible?


I read somewhere else about someone wanting to do it in Java which is how I made the below script(using Python), which gives me errors so I'm not sure if I have things wrong here:

body = {
        'records': {
            'id': _queueAdd[0],
            'id': _queueAdd[1],
            'id': _queueAdd[2],
            'id': _queueAdd[3],
        },
    },
r = platform.get(f'/restapi/v1.0/account/~/extension/{extensionId}/call-queues', body)

Thinking maybe 'records' is what was breaking it, I removed that from the body as shown below, still no success. Thinking maybe the error below this script might be my issue, and I need to be given more permissions to the account calls?

body = {
    'id': _queueAdd[0],
    'id': _queueAdd[1],
    'id': _queueAdd[2],
    'id': _queueAdd[3],
    },
r = platform.get(f'/restapi/v1.0/account/~/extension/{extensionId}/call-queues', body)



When trying through the link below and clicking "Try It Out" through the API references it says:

{
"errorCode":"InsufficientPermissions"
"message":"In order to call this API endpoint, application needs to have [Accounts] permission"
"errors":[
0:{
"errorCode":"CMN-401"
"message":"In order to call this API endpoint, application needs to have [Accounts] permission"
"permissionName":"Accounts"
}
]
"permissionName":"Accounts"
}

Link: https://developers.ringcentral.com/api-reference/Call-Queues/updateUserCallQueues


Could there be other permissions I don't have under Accounts? If so can I have those permissions?

apicall queuespermissionsdevelopersapi permissions
1 |1500 characters needed characters left characters exceeded

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

1 Answer

Phong Vu avatar image
Phong Vu answered ·

First of all, you have to make a PUT instead of a GET to update something

r = platform.put('/restapi/v1.0/account/~/extension/{extensionId}/call-queues', body)

Secondly, it looks like your app does not have the Account permission. You'll need to send a request to devsupport@ringcentral.com for help with this.

2 comments
1 |1500 characters needed characters left characters exceeded

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

Phong, thanks again for your help. Sorry, I feel silly for not knowing that, but I'm still learning API calls and assumed GET just transmitted the information you're requesting/changing, but makes sense that there is a way to differentiate the two. Need to go back to reading more about how they work.


I'll send the request over for the permissions, thanks again.

0 Likes 0 ·

No problem. Just pay attention to the HTTP method we state in the API reference.

screen-shot-2020-11-22-at-25532-pm.png

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