Coder Social home page Coder Social logo

Comments (7)

JosephMcEvoy avatar JosephMcEvoy commented on June 19, 2024

You can try and use PSZoom/Public/Utils/Invoke-ZoomRestMethod.ps1. This hasn't bee added to PowerShell Gallery, yet. Ideally you would open up a pull request and add the functionality.

from pszoom.

izirdum-FGSD avatar izirdum-FGSD commented on June 19, 2024

I see... I was actually meaning to ask how to update a user's role (https://marketplace.zoom.us/docs/api-reference/zoom-api/roles/addrolemembers), but I imagine it's the same answer.

from pszoom.

izirdum-FGSD avatar izirdum-FGSD commented on June 19, 2024

Woohoo.. it's a steep learning curve, but thank you for making it less steep!

from pszoom.

izirdum-FGSD avatar izirdum-FGSD commented on June 19, 2024

Actually... one quick question... I got it to list the roles using this:
$request = [System.UriBuilder]"https://api.zoom.us/v2/roles/{roleId}/members"
Invoke-ZoomRestMethod -Uri $request.Uri -ApiKey $($ZoomApiKey) -ApiSecret $($ZoomApiSecret) -Method GET

So building on that I can set the roles using this I imagine, but I'm not sure how to add the userID to this so that it updates a specific user's role?

$request = [System.UriBuilder]"https://api.zoom.us/v2/roles/RoleIDGoesHere/members"
Invoke-ZoomRestMethod -Uri $request.Uri -ApiKey $($ZoomApiKey) -ApiSecret $($ZoomApiSecret) -Method POST

from pszoom.

izirdum-FGSD avatar izirdum-FGSD commented on June 19, 2024

Ah, figured it out... I added -Body '{"members":[{"id":"MemberIDHere"}]}' and it worked!! Thanks so much for creating this!

from pszoom.

JosephMcEvoy avatar JosephMcEvoy commented on June 19, 2024

Something like this (code not verified):

$roleid = 'admin'
$members = @(@{id = 'izirdum'},@{id = 'izirdumsfriend'})
$request = [System.UriBuilder]"https://api.zoom.us/v2/roles/$($roleid)/members"
$requestBody = @{
members = $members
}

$requestBody = $requestBody | ConvertTo-Json
 Invoke-ZoomRestMethod -Uri $request.Uri -Headers ([ref]$Headers) -Body $requestBody -Method POST -ApiKey $ApiKey -ApiSecret $ApiSecret

from pszoom.

JosephMcEvoy avatar JosephMcEvoy commented on June 19, 2024

Ah, figured it out... I added -Body '{"members":[{"id":"MemberIDHere"}]}' and it worked!! Thanks so much for creating this!

Nice work. You're welcome.

from pszoom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.