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?
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 submit a support ticket to help change this.
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.
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder