Webex Teams Developer



Cisco webex developerDownloadWebex Teams DeveloperWebex

Or, “API Basics for Powershelling Windows Admins”

My team has begun rolling out Cisco’s Webex Teams collaboration platform to our internal users. As is often the case, the IT department is the first customer, kicking the tires and exploring different use cases. I happened to be working on a Powershell-based script to create new Active Directory users, and decided to get creative …

While creating a Powershell process to automatically create new Active Directory users based on data sent via our HRIS system, I wanted a way to notify the Helpdesk team that a user had been added and they needed to do a few follow-up tasks (actions I can’t address via Powershell). I looked at having Powershell write logfiles or send e-mails. Old-fashioned.

Naturally, Webex Teams is fully API-enabled . As a non-developer, the most approachable methods I’d previously seen for addressing Teams via its API had been using Python. However, I found some clues for using Powershell in a Cisco DEVNET lesson introducing the Teams API (sign-in required).

Teams are groups of people with a set of rooms that are visible to all members of that team. This API is used to manage the teams themselves. Teams are created and deleted with this API. You can also update a team to change its name, for example. To manage people in a team see the Team Memberships API. To manage team rooms see the Rooms API.

With credit to this article, and through some modification, I got to scripting a sample:

Now to get this working, you’ll need some stuff:

Webex Teams Developers

  • Cisco Webex Teams - developer sample demonstrating use of JWT with the Webex Teams widgets JavaScript MIT 2 0 0 0 Updated Jun 7, 2018.
  • To use the Webex REST API you'll need a Webex account backed by Cisco Webex Common Identity (CI). If you already have a Webex account, you're all set. If you're using Webex Meetings, your site will need to be on Common Identity. If you don't already have a Webex account, go ahead and sign up! You'll need an account to use the APIs and SDKs.
  • Enabling Integration via Webex Teams and Cisco DNA, SD-Wan, Intersight, Thousand Eyes via Cloud API Gateway. I was really excited to have a unique opportunity to put together a team of my fellow engineers to work on a Collaboration hacking contest within Cisco.
  1. A Bot account (who’s going to post these messages [or take any other type of action])
    1. Create one here: https://developer.webex.com/my-apps/
  2. Your Bot’s access token (you’ll get one after you create the bot account)
  3. Room ID (where you’re posting the message to)
    1. Add your new bot to the Webex Teams space you want them to post in
    2. Look up the RoomID: https://developer.webex.com/docs/api/v1/rooms/list-rooms
    3. Hit the “Try It” button, and provide the Bearer (access token) of your Bot account; you’ll see each space the Bot is a member of. Copy the “Id”

In my sample above, I’m storing the Bot’s access token in a local text file, reading it in, and storing it as a SecureString to a variable. But you can equally just put it directly in the Bearer section of the Authorization header.

Once you execute your code:

Ultimately I ended up writing this whole process above as a Powershell function and calling it as needed during my User Creation script. Setting the text to a variable, and changing the contents as needed became easy.

Putting it into action:

Webex Teams Developer Jobs

Notification of a successful user creation

Webex Teams Developer Training

Conditional error, when licensing a user in Office365 fails.

Webex Teams Developer Salary

Seeing how easy it was to cook this up, I’m inclined to try some of the other API actions in and out of Webex Teams using Powershell … you don’t have to be a developer to get dirty with APIs!