You are on page 1of 7

Lab - Using Cisco Webex for Developers to Manage Messages

and Rooms
Objectives
Part 1: Creating a Room with Cisco Webex for Developers
Part 2: Creating and Deleting Messages with Cisco Webex for Developers

Background / Scenario
In this lab you will make API requests using Cisco Webex for Developers to create a room, create messages,
and delete messages. You use both request parameters and path parameters to accomplish these tasks.

Required Resources
• Webex Teams account
• Webex Teams desktop application

Part 1: Creating a Room with Cisco Webex for Developers

Step 1: Create a room.


a. Go to the API Reference in the Documentation page of the Cisco Webex for Developers web site at
https://developer.webex.com/.
b. Click Rooms > Create a Room.

 2017 - 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 7 www.netacad.com
Lab – Using Cisco Webex for Developers to Manage Messages and Rooms

c. The Create a Room service endpoint requires a title. Enter a name for the room in the title field and click
Run, as shown below.

Step 2: Verify the room was created.


a. View the JSON output and your Webex Teams application to verify the new room was created.

b. Copy the id value, without quotes. This value uniquely identifies the room. It will be used in the next two
steps to get room details and add persons to the room.

 2017 - 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 7 www.netacad.com
Lab – Using Cisco Webex for Developers to Manage Messages and Rooms

Step 3: Get room details.


a. Under API Reference, click Rooms > Get Room Details.
b. At the end of the GET URL, click the roomId down arrow. Paste the ID value for the room you created in
the previous step, as shown below.
This is known as a path parameter. A path parameter embeds the unique identifier of a specific resource
directly in the API URL. This usually implies that the parameter is for a specific resource that exists as a
unique entity on the API endpoint.

c. Click Run and examine the JSON information in the Response section. Additional information in the
JSON response includes ID of the person who created the room and the date/time of the last activity for
the room.

Step 4: Add a person to the room.


a. Under API Reference, click Memberships > Create a Membership.
b. For roomId, paste the ID value you copied earlier.

 2017 - 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 7 www.netacad.com
Lab – Using Cisco Webex for Developers to Manage Messages and Rooms

c. For personEmail, add the email of someone in your class or use one of the demonstration email
addresses. This must be the email address they used to create their Webex Teams account. Click Run.

d. Verify the person was added to the group by examining the JSON output and by viewing your Webex
Teams application.

Step 5: List memberships of the room.


You can list information for all members of a room by referring to the roomId value.

 2017 - 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 7 www.netacad.com
Lab – Using Cisco Webex for Developers to Manage Messages and Rooms

a. Under API Reference, click Memberships > List Memberships.


b. For the roomId parameter, paste the ID value you copied earlier. Click Run.

 2017 - 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 7 www.netacad.com
Lab – Using Cisco Webex for Developers to Manage Messages and Rooms

c. Examine the JSON output to verify the membership list.

Part 2: Creating and Deleting Messages with Cisco Webex for Developers

Step 1: Join a shared group.


a. Form a small group with other members in your class.
b. Create a new room and add everyone in the group to the room.
c. Use the List Rooms service endpoint to list all the rooms and copy the id of the new room to your
clipboard.

Step 2: Post a message.


a. To post messages to the room, select the Create a Message service endpoint under Messages.
b. In the Body section, paste the ID you copied from List Rooms into roomId field.
c. In the text field, enter a message that will be sent to the room members. Click Run.
d. Verify that the message was posted with a response status of 200. Look for the new message in the room
using the Webex Teams application.
e. Post several messages using the API.

Step 3: List messages.


a. Go to the List Messages service endpoint under Messages.
b. In the Parameters section, paste the ID for the room that you copied from List Rooms into roomId.
c. Click Run to view the messages.
d. Choose one of the messages that you created to delete. Copy the id value of the message. This id value
uniquely identifies a specific message.

 2017 - 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 7 www.netacad.com
Lab – Using Cisco Webex for Developers to Manage Messages and Rooms

Step 4: Delete a message.


a. Go to the Delete a Message service endpoint under Messages.
b. At the end of the DELETE URL, click messageId and paste in the id value from the previous step.
c. Verify that the message was deleted with a response message of 204. Verify that the message was
deleted in the Webex Teams application.

 2017 - 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 7 www.netacad.com

You might also like