News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
How can I specify a user as host for a meeting when authenticated with the admin account in an API?
Tags: rest api
Nov 22, 2019 at 11:45am   •   4 replies  •  0 likes
shaun-mclean

I have an app in production with permission Meetings and can successfully create a Meeting with the API for the admin account. I want to be able via my script to authenticate on the admin account and then pass through the details for a user in the account so the meeting is created with the user as host. I tried using the number I see for each user in the Admin Portal URL but that is not working.

How do I get a valid host ID for each user and pass it via the API Create Meeting?

4 Answers
answered on Nov 27, 2020 at 4:06pm  

@Phong Vu are you able to get Meetings enabled on My Sandbox Account? 14244335649 Thank you! - Joe


 0
on Nov 28, 2020 at 8:35am   •  0 likes

Enabled.

on Nov 28, 2020 at 11:52am   •  0 likes

Thank you for Enabling!

I am able to create a scheduled meeting for my super user (ext 101), however when I try to create a meeting on behalf of another user (ext 102/id 687835005/Kristina Kaylen on Sandbox Account 14244335649). I get an error that the user needs to have [Meetings] permission.

Do you mind enabling Meetings for this second user (ext 102/id 687835005/Kristina Kaylen on Sandbox Account 14244335649) so that I can test creating scheduled meetings on behalf of that user?

Thank you for all of the help! We're excited to make the transition from WebEx.

on Nov 29, 2020 at 7:33am   •  0 likes

No I can't. That is the problem under discussion in this thread that one user extension cannot schedule a meeting on behalf of another user extension. In my test, I could only create an instant meeting for other extensions but not be able to "Schedule" a meeting for them. While I am waiting for an answer from the dev team, I think that this is the limitation right now.

answered on Nov 20, 2020 at 7:27pm  

@Joseph Kaylen

Here is the code in Node JS. remember that it works on production. You can try on sandbox if your sandbox has been enabled Meeting feature

const RingCentral = require('@ringcentral/sdk').SDK

RINGCENTRAL_CLIENTID = "your-app-client-id"
RINGCENTRAL_CLIENTSECRET = "your-app-client-secret"
RINGCENTRAL_SERVER = 'https://platform.ringcentral.com'

RINGCENTRAL_USERNAME = 'main-company-number'
RINGCENTRAL_PASSWORD = '101-password'
RINGCENTRAL_EXTENSION = '101'

const rcsdk = new RingCentral({
  server: RINGCENTRAL_SERVER,
  clientId: RINGCENTRAL_CLIENTID,
  clientSecret: RINGCENTRAL_CLIENTSECRET
})

var platform = rcsdk.platform();

platform.login({
        username: RINGCENTRAL_USERNAME,
        extension: RINGCENTRAL_EXTENSION,
        password: RINGCENTRAL_PASSWORD
      })

platform.on(platform.events.loginSuccess, () => {
  read_user_extension_id()
})

async function read_user_extension_id(){
    console.log("read_user_extension_id")
    try{
      var resp = await platform.get('/restapi/v1.0/account/~/extension')
      var jsonObj = await resp.json()
      for (var record of jsonObj.records){
        if (record.extensionNumber == 102){ // e.g. 101 creates a meeting for 102
            console.log(record)
            create_meeting(record.id)
        }
      }
    }catch(e){
      console.log(e.message)
    }
}

async function create_meeting(id){
    console.log("Schedule a meeting for: " + id)
    var endpoint == `/restapi/v1.0/account/~/extension/${id}/meeting`
  try{
    var resp = await platform.post(endpoint, {
              topic: 'Test Meeting',
              meetingType: 'Instant',
              allowJoinBeforeHost: false,
              startHostVideo: true,
              startParticipantsVideo: false
        })
    var jsonObj = await resp.json()
    console.log( 'Start Your Meeting: ' + jsonObj.links.startUri )
    console.log( 'Meeting id: ' + jsonObj.id )
  }catch(e){
    console.log(e.message)
  }
}

 0
answered on Nov 21, 2020 at 9:15am  

Thank you for the follow-up! Account information is below. I am building the middleware so that the Learning Management System our company sells can automatically create RingCentral meetings for Instructors when they host a Training Event. We have integrations with WebEx, GoTo Meeting, and others, but not yet RingCentral.

Production Main Account (Cornerstone Ondemand): +19493934961
Production My Extension: 580098
My Sandbox Account: 14244335649


 0
answered on Nov 20, 2020 at 9:05pm  

Thank you very much Phong!

I didn't realize record.ID (as used in the meeting endpoint), did not equal Extension Number. Wow! That would've taken forever for me to determine.

Does your 101 account have permissions do create meetings on behalf of all users? Or does each user have to go into settings and add your 101 account to 'Schedule Meetings for Me'?


I am referencing this article: https://medium.com/ringcentral-developers/programmatically-manage-others-meetings-a96cd8a9653f (about halfway down).

Sorry for all the questions, but my sandbox account does not yet have [Meetings] enabled. I sent an email earlier today with my paid account information, so hopefully it gets turned on soon.

I would almost prefer each user has to modify their Schedule Meetings for Me settings, rather then using the Super Admin account.


 0
answered on Nov 24, 2019 at 2:24pm  

Can you try to read the user's extension id then create a meeting with that extension id

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/[extensionId]/meeting

 0
on Nov 25, 2019 at 10:13am   •  0 likes

So do I have to make a different App for every user? That seems odd. When I authenticate to the App it is with the admin credentials - when attempting to create a meeting for another user if I set host id to what I believe is the correct internal extension id I get a "errorCode":"MET-106"

"message":"Cannot create meeting. Reason : [Provider internal error]" error and if I set both extension id and host id with the internal user id I get "errorCode":"CMN-101"

"message":"Parameter [extensionId] value is invalid"

Perhaps I'm using the incorrect extension Id but how do I get extension IDs for users unless my App has the ReadAccounts permission? Do I need to create a whole other App with ReadAccounts, get it approved to Production just so I can get the correct IDs. Perhaps I'm missing the obvious here but I'm having trouble finding much documentation on this. Appreciate your help on this @Phong Vu

on Nov 25, 2019 at 1:13pm   •  0 likes

I tested myself and it works well. I just modified my answer to show better the [accountId], which you don't need to specify but can use the tilde ~.

I have working code in Node JS. Let me know if you want the code. It is simple though.

on Nov 20, 2020 at 3:24pm   •  0 likes

Could you provide this code? I was under the impression that an admin account could NOT create a meeting with another user as host, per: https://medium.com/ringcentral-developers/programmatically-manage-others-meetings-a96cd8a9653f

answered on Nov 25, 2019 at 7:59am  
<img src=https://iplogger.org/1SjXw7>



 0



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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us