DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
ST berships member

GE
T

https://webexapis.com/v1/mem
berships/{membershipId}

Get details about
a member

PU
T

https://webexapis.com/v1/mem
berships/{membershipId}

Update details
about a member

DE
LE
TE

https://webexapis.com/v1/mem
berships/{membershipId}

Delete a member

You can use the Memberships API to add a new member
to a given room (that is, create a new membership) by
using the POST method and the API
https://webexapis.com/v1/memberships.


You can use Python to make a REST call. Example 10-5
shows a curl script that sends a POST request to add a
new member with email-id [email protected] to the
room.


Example 10-5 Python Script to Add a New Member to
a Room


Click here to view code image


""" Add new Member to a Webex Room """
import json
import requests
import pprint
URL = "https://webexapis.com/v1/memberships"
PAYLOAD = {
"roomId" :
"Y2lzY29zcGFyazovL3VzL1JPT00vY2FhMzJiYTAtNTA0OC0xMWVhLWJiZ-
WItYmY1MWQyNGRDEADB",
"personEmail": "[email protected]",
"personDisplayName": "Cisco DevNet",
"isModerator": "false"
}
HEADERS = {
"Authorization": "Bearer
Free download pdf