User API Doc

WebexTeamsAPI

The WebexTeamsAPI class creates “connection objects” for working with the Webex Teams APIs and hierarchically organizes the Webex Teams APIs and their endpoints underneath these connection objects.

WebexTeamsAPI access_tokens get() refresh()
  admin_audit_events list()
  attachment_actions create() get()
  events list() get()
  guest_issuer create()
  licenses list() create()
  memberships list() create() get() update() delete()
  messages list() list_direct() create() get() delete()
  organizations list() create()
  people list() create() get() update() me()
  roles list() create()
  rooms list() create() get() get_meeting_info() update() delete()
  team_memberships list() create() get() update() delete()
  teams list() create() get() update() delete()
  webhooks list() create() get() update() delete()
class WebexTeamsAPI[source]

Webex Teams API wrapper.

Creates a ‘session’ for all API calls through a created WebexTeamsAPI object. The ‘session’ handles authentication, provides the needed headers, and checks all responses for error conditions.

WebexTeamsAPI wraps all of the individual Webex Teams APIs and represents them in a simple hierarchical structure.

__init__(access_token=None, base_url='https://webexapis.com/v1/', single_request_timeout=60, wait_on_rate_limit=True, object_factory=<function immutable_data_factory>, client_id=None, client_secret=None, oauth_code=None, redirect_uri=None, proxies=None, be_geo_id=None, caller=None)[source]

Create a new WebexTeamsAPI object.

An access token must be used when interacting with the Webex Teams API. This package supports three methods for you to provide that access token:

  1. You may manually specify the access token via the access_token argument, when creating a new WebexTeamsAPI object.
  2. If an access_token argument is not supplied, the package checks for a WEBEX_TEAMS_ACCESS_TOKEN environment variable.
  3. Provide the parameters (client_id, client_secret, oauth_code and oauth_redirect_uri) from your oauth flow.

An AccessTokenError is raised if an access token is not provided via one of these two methods.

Parameters:
  • access_token (basestring) – The access token to be used for API calls to the Webex Teams service. Defaults to checking for a WEBEX_TEAMS_ACCESS_TOKEN environment variable.
  • base_url (basestring) – The base URL to be prefixed to the individual API endpoint suffixes. Defaults to webexteamssdk.DEFAULT_BASE_URL.
  • single_request_timeout (int) – Timeout (in seconds) for RESTful HTTP requests. Defaults to webexteamssdk.config.DEFAULT_SINGLE_REQUEST_TIMEOUT.
  • wait_on_rate_limit (bool) – Enables or disables automatic rate-limit handling. Defaults to webexteamssdk.config.DEFAULT_WAIT_ON_RATE_LIMIT.
  • object_factory (callable) – The factory function to use to create Python objects from the returned Webex Teams JSON data objects.
  • client_id (basestring) – The client id of your integration. Provided upon creation in the portal.
  • client_secret (basestring) – The client secret of your integration. Provided upon creation in the portal.
  • oauth_code (basestring) – The oauth authorization code provided by the user oauth process.
  • oauth_redirect_uri (basestring) – The redirect URI used in the user OAuth process.
  • proxies (dict) – Dictionary of proxies passed on to the requests session.
  • be_geo_id (basestring) – Optional partner identifier for API usage tracking. Defaults to checking for a BE_GEO_ID environment variable.
  • caller (basestring) – Optional identifier for API usage tracking. Defaults to checking for a WEBEX_PYTHON_SDK_CALLER environment variable.
Returns:

A new WebexTeamsAPI object.

Return type:

WebexTeamsAPI

Raises:
  • TypeError – If the parameter types are incorrect.
  • AccessTokenError – If an access token is not provided via the access_token argument or an environment variable.
single_request_timeout

Timeout (in seconds) for an single HTTP request.

wait_on_rate_limit

Automatic rate-limit handling enabled / disabled.

access_tokens = <webexteamssdk.api.access_tokens.AccessTokensAPI object>
classmethod from_oauth_code(client_id, client_secret, code, redirect_uri)[source]

Create a new WebexTeamsAPI connection object using an OAuth code.

Exchange an Authorization Code for an Access Token, then use the access token to create a new WebexTeamsAPI connection object.

Parameters:
  • client_id (basestring) – Provided when you created your integration.
  • client_secret (basestring) – Provided when you created your integration.
  • code (basestring) – The Authorization Code provided by the user OAuth process.
  • redirect_uri (basestring) – The redirect URI used in the user OAuth process.
Returns:

A new WebexTeamsAPI object initialized with the access token from the OAuth Authentication Code exchange.

Return type:

WebexTeamsAPI

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
classmethod from_oauth_refresh(client_id, client_secret, refresh_token)[source]

Create a new WebexTeamsAPI connection object using an OAuth refresh.

Exchange a refresh token for an Access Token, then use the access token to create a new WebexTeamsAPI connection object.

Parameters:
  • client_id (basestring) – Provided when you created your integration.
  • client_secret (basestring) – Provided when you created your integration.
  • refresh_token (basestring) – Provided when you requested the Access Token.
Returns:

A new WebexTeamsAPI object initialized with the access token from the OAuth Refresh Token exchange.

Return type:

WebexTeamsAPI

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

access_tokens

class AccessTokensAPI[source]

Webex Teams Access-Tokens API.

Wraps the Webex Teams Access-Tokens API and exposes the API as native Python methods that return native Python objects.

base_url

The base URL the API endpoints.

single_request_timeout

Timeout in seconds for the API requests.

get(client_id, client_secret, code, redirect_uri)[source]

Exchange an Authorization Code for an Access Token.

Exchange an Authorization Code for an Access Token that can be used to invoke the APIs.

Parameters:
  • client_id (basestring) – Provided when you created your integration.
  • client_secret (basestring) – Provided when you created your integration.
  • code (basestring) – The Authorization Code provided by the user OAuth process.
  • redirect_uri (basestring) – The redirect URI used in the user OAuth process.
Returns:

An AccessToken object with the access token provided by the Webex Teams cloud.

Return type:

AccessToken

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
refresh(client_id, client_secret, refresh_token)[source]

Return a refreshed Access Token from the provided refresh_token.

Parameters:
  • client_id (basestring) – Provided when you created your integration.
  • client_secret (basestring) – Provided when you created your integration.
  • refresh_token (basestring) – Provided when you requested the Access Token.
Returns:

With the access token provided by the Webex Teams cloud.

Return type:

AccessToken

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

admin_audit_events

class AdminAuditEventsAPI[source]

Admin Audit Events API.

Wraps the Webex Teams Admin Audit Events API and exposes the API as native Python methods that return native Python objects.

list(orgId, _from, to, actorId=None, max=100, offset=0, **request_parameters)[source]

List Organizations.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all audit events returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • orgId (basestring) – List events in this organization, by ID.
  • _from (basestring) – List events which occurred after a specific date and time.
  • to (basestring) – List events which occurred before a specific date and time.
  • actorId (basestring) – List events performed by this person, by ID.
  • max (int) – Limit the maximum number of events in the response. The maximum value is 200.
  • offset (int) – Offset from the first result that you want to fetch.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the organizations returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

attachment_actions

class AttachmentActionsAPI[source]

Webex Teams Attachment Actions API.

Wraps the Webex Teams Attachment Actions API and exposes the API as native Python methods that return native Python objects.

create(type, messageId, inputs, **request_parameters)[source]

Create a new attachment action.

Parameters:
  • type (basestring) – The type of action to perform.
  • messageId (basestring) – The ID of the message which contains the attachment.
  • inputs (dict) – The attachment action’s inputs.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A attachment action object with the details of the created attachment action.

Return type:

AttachmentAction

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
  • ValueError – If the files parameter is a list of length > 1, or if the string in the list (the only element in the list) does not contain a valid URL or path to a local file.
get(id)[source]

Get the details for a attachment action, by ID.

Parameters:

id (basestring) – A unique identifier for the attachment action.

Returns:

A Attachment Action object with the details of the requested attachment action.

Return type:

AttachmentAction

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

events

class EventsAPI[source]

Webex Teams Events API.

Wraps the Webex Teams Events API and exposes the API as native Python methods that return native Python objects.

list(resource=None, type=None, actorId=None, _from=None, to=None, max=None, **request_parameters)[source]

List events.

List events in your organization. Several query parameters are available to filter the response.

Note: from is a keyword in Python and may not be used as a variable name, so we had to use _from instead.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all events returned by the query. The generator will automatically request additional ‘pages’ of responses from Wevex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • resource (basestring) – Limit results to a specific resource type. Possible values: “messages”, “memberships”.
  • type (basestring) – Limit results to a specific event type. Possible values: “created”, “updated”, “deleted”.
  • actorId (basestring) – Limit results to events performed by this person, by ID.
  • _from (basestring) – Limit results to events which occurred after a date and time, in ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ).
  • to (basestring) – Limit results to events which occurred before a date and time, in ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ).
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the events returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(eventId)[source]

Get the details for an event, by event ID.

Parameters:

eventId (basestring) – The ID of the event to be retrieved.

Returns:

A event object with the details of the requested room.

Return type:

Event

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

guest_issuer

class GuestIssuerAPI[source]

Webex Teams Guest Issuer API.

Wraps the Webex Teams Guest Issuer API and exposes the API as native methods that return native Python objects.

create(sub, name, iss, exp, secret)[source]

Create a new guest issuer using the provided issuer token.

This function returns a guest issuer with an api access token.

Parameters:
  • sub (basestring) – The subject of the token. This is your unique and public identifier for the guest user. This claim may contain only letters, numbers, and hyphens.
  • name (basestring) – The display name of the guest user. This will be the name shown in Webex Teams clients.
  • iss (basestring) – The issuer of the token. Use the Guest Issuer ID provided in My Webex Teams Apps.
  • exp (basestring) – The exp time of the token, as a UNIX timestamp in seconds. Use the lowest practical value for the use of the token. This is not the exp time for the guest user’s session.
  • secret (basestring) – Use the secret Webex provided you when you created your Guest Issuer App. The secret will be used to sign the token request.
Returns:

A Guest Issuer token with a valid access token.

Return type:

GuestIssuerToken

Raises:
  • TypeError – If the parameter types are incorrect
  • ApiError – If the webex teams cloud returns an error.

licenses

class LicensesAPI[source]

Webex Teams Licenses API.

Wraps the Webex Teams Licenses API and exposes the API as native Python methods that return native Python objects.

list(orgId=None, **request_parameters)[source]

List all licenses for a given organization.

If no orgId is specified, the default is the organization of the authenticated user.

Parameters:
  • orgId (basestring) – Specify the organization, by ID.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the licenses returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(licenseId)[source]

Get the details of a License, by ID.

Parameters:

licenseId (basestring) – The ID of the License to be retrieved.

Returns:

A License object with the details of the requested License.

Return type:

License

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

memberships

class MembershipsAPI[source]

Webex Teams Memberships API.

Wraps the Webex Teams Memberships API and exposes the API as native Python methods that return native Python objects.

list(roomId=None, personId=None, personEmail=None, max=None, **request_parameters)[source]

List room memberships.

By default, lists memberships for rooms to which the authenticated user belongs.

Use query parameters to filter the response.

Use roomId to list memberships for a room, by ID.

Use either personId or personEmail to filter the results.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all memberships returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • roomId (basestring) – Limit results to a specific room, by ID.
  • personId (basestring) – Limit results to a specific person, by ID.
  • personEmail (basestring) – Limit results to a specific person, by email address.
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the memberships returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
create(roomId, personId=None, personEmail=None, isModerator=False, **request_parameters)[source]

Add someone to a room by Person ID or email address.

Add someone to a room by Person ID or email address; optionally making them a moderator.

Parameters:
  • roomId (basestring) – The room ID.
  • personId (basestring) – The ID of the person.
  • personEmail (basestring) – The email address of the person.
  • isModerator (bool) – Set to True to make the person a room moderator.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Membership object with the details of the created membership.

Return type:

Membership

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(membershipId)[source]

Get details for a membership, by ID.

Parameters:

membershipId (basestring) – The membership ID.

Returns:

A Membership object with the details of the requested membership.

Return type:

Membership

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
update(membershipId, isModerator=None, **request_parameters)[source]

Update properties for a membership, by ID.

Parameters:
  • membershipId (basestring) – The membership ID.
  • isModerator (bool) – Set to True to make the person a room moderator.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Membership object with the updated Webex Teams membership details.

Return type:

Membership

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
delete(membershipId)[source]

Delete a membership, by ID.

Parameters:

membershipId (basestring) – The membership ID.

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

messages

class MessagesAPI[source]

Webex Teams Messages API.

Wraps the Webex Teams Messages API and exposes the API as native Python methods that return native Python objects.

list(roomId, parentId=None, mentionedPeople=None, before=None, beforeMessage=None, max=50, **request_parameters)[source]

Lists messages in a room.

Each message will include content attachments if present.

The list API sorts the messages in descending order by creation date.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all messages returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • roomId (basestring) – List messages for a room, by ID.
  • parentId (basestring) – List messages with a parent, by ID.
  • mentionedPeople (basestring) – List messages where the caller is mentioned by specifying “me” or the caller personId.
  • before (basestring) – List messages sent before a date and time, in ISO8601 format.
  • beforeMessage (basestring) – List messages sent before a message, by ID.
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the messages returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
list_direct(personId=None, personEmail=None, parentId=None, **request_parameters)[source]

List all messages in a 1:1 (direct) room.

Use the personId or personEmail query parameter to specify the room.

The list API sorts the messages in descending order by creation date.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all messages returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • personId (basestring) – List messages in a 1:1 room, by person ID.
  • personEmail (basestring) – List messages in a 1:1 room, by person email.
  • parentId (basestring) – List messages with a parent, by ID.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the messages returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
create(roomId=None, parentId=None, toPersonId=None, toPersonEmail=None, text=None, markdown=None, files=None, attachments=None, **request_parameters)[source]

Post a message to a room.

The files parameter is a list, which accepts multiple values to allow for future expansion, but currently only one file may be included with the message.

Parameters:
  • roomId (basestring) – The room ID.
  • toPersonId (basestring) – The ID of the recipient when sending a private 1:1 message.
  • toPersonEmail (basestring) – The email address of the recipient when sending a private 1:1 message.
  • text (basestring) – The message, in plain text. If markdown is specified this parameter may be optionally used to provide alternate text for UI clients that do not support rich text.
  • markdown (basestring) – The message, in markdown format.
  • files (list) – A list of public URL(s) or local path(s) to files to be posted into the room. Only one file is allowed per message.
  • attachments (list) – Content attachments to attach to the message. See the Cards Guide for more information.
  • parentId (basestring) – The parent message to reply to. This will start or reply to a thread.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Message object with the details of the created message.

Return type:

Message

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
  • ValueError – If the files parameter is a list of length > 1, or if the string in the list (the only element in the list) does not contain a valid URL or path to a local file.
get(messageId)[source]

Get the details of a message, by ID.

Parameters:

messageId (basestring) – The ID of the message to be retrieved.

Returns:

A Message object with the details of the requested message.

Return type:

Message

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
delete(messageId)[source]

Delete a message.

Parameters:

messageId (basestring) – The ID of the message to be deleted.

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

organizations

class OrganizationsAPI[source]

Webex Teams Organizations API.

Wraps the Webex Teams Organizations API and exposes the API as native Python methods that return native Python objects.

list(**request_parameters)[source]

List Organizations.

Parameters:

**request_parameters – Additional request parameters (provides support for parameters that may be added in the future).

Returns:

A GeneratorContainer which, when iterated, yields the organizations returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(orgId)[source]

Get the details of an Organization, by ID.

Parameters:

orgId (basestring) – The ID of the Organization to be retrieved.

Returns:

An Organization object with the details of the requested organization.

Return type:

Organization

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

people

class PeopleAPI[source]

Webex Teams People API.

Wraps the Webex Teams People API and exposes the API as native Python methods that return native Python objects.

list(email=None, displayName=None, id=None, orgId=None, max=None, **request_parameters)[source]

List people in your organization.

For most users, either the email or displayName parameter is required. Admin users can omit these fields and list all users in their organization.

Response properties associated with a user’s presence status, such as status or lastActivity, will only be displayed for people within your organization or an organization you manage. Presence information will not be shown if the authenticated user has disabled status sharing.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all people returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • email (basestring) – The e-mail address of the person to be found.
  • displayName (basestring) – The complete or beginning portion of the displayName to be searched.
  • id (basestring) – List people by ID. Accepts up to 85 person IDs separated by commas.
  • orgId (basestring) – The organization ID.
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the people returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
create(emails, displayName=None, firstName=None, lastName=None, avatar=None, orgId=None, roles=None, licenses=None, **request_parameters)[source]

Create a new user account for a given organization

Only an admin can create a new user account.

Parameters:
  • emails (list) – Email address(es) of the person (list of strings).
  • displayName (basestring) – Full name of the person.
  • firstName (basestring) – First name of the person.
  • lastName (basestring) – Last name of the person.
  • avatar (basestring) – URL to the person’s avatar in PNG format.
  • orgId (basestring) – ID of the organization to which this person belongs.
  • roles (list) – Roles of the person (list of strings containing the role IDs to be assigned to the person).
  • licenses (list) – Licenses allocated to the person (list of strings - containing the license IDs to be allocated to the person).
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Person object with the details of the created person.

Return type:

Person

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(personId)[source]

Get a person’s details, by ID.

Parameters:

personId (basestring) – The ID of the person to be retrieved.

Returns:

A Person object with the details of the requested person.

Return type:

Person

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
update(personId, emails=None, displayName=None, firstName=None, lastName=None, avatar=None, orgId=None, roles=None, licenses=None, **request_parameters)[source]

Update details for a person, by ID.

Only an admin can update a person’s details.

Email addresses for a person cannot be changed via the Webex Teams API.

Include all details for the person. This action expects all user details to be present in the request. A common approach is to first GET the person’s details, make changes, then PUT both the changed and unchanged values.

Parameters:
  • personId (basestring) – The person ID.
  • emails (list) – Email address(es) of the person (list of strings).
  • displayName (basestring) – Full name of the person.
  • firstName (basestring) – First name of the person.
  • lastName (basestring) – Last name of the person.
  • avatar (basestring) – URL to the person’s avatar in PNG format.
  • orgId (basestring) – ID of the organization to which this person belongs.
  • roles (list) – Roles of the person (list of strings containing the role IDs to be assigned to the person).
  • licenses (list) – Licenses allocated to the person (list of strings - containing the license IDs to be allocated to the person).
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Person object with the updated details.

Return type:

Person

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
delete(personId)[source]

Remove a person from the system.

Only an admin can remove a person.

Parameters:

personId (basestring) – The ID of the person to be deleted.

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
me()[source]

Get the details of the person accessing the API.

Raises:ApiError – If the Webex Teams cloud returns an error.

roles

class RolesAPI[source]

Webex Teams Roles API.

Wraps the Webex Teams Roles API and exposes the API as native Python methods that return native Python objects.

list(**request_parameters)[source]

List all roles.

Parameters:

**request_parameters – Additional request parameters (provides support for parameters that may be added in the future).

Returns:

A GeneratorContainer which, when iterated, yields the roles returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(roleId)[source]

Get the details of a Role, by ID.

Parameters:

roleId (basestring) – The ID of the Role to be retrieved.

Returns:

A Role object with the details of the requested Role.

Return type:

Role

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

rooms

class RoomsAPI[source]

Webex Teams Rooms API.

Wraps the Webex Teams Rooms API and exposes the API as native Python methods that return native Python objects.

list(teamId=None, type=None, sortBy=None, max=100, **request_parameters)[source]

List rooms.

By default, lists rooms to which the authenticated user belongs.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all rooms returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • teamId (basestring) – Limit the rooms to those associated with a team, by ID.
  • type (basestring) – ‘direct’ returns all 1-to-1 rooms. group returns all group rooms. If not specified or values not matched, will return all room types.
  • sortBy (basestring) – Sort results by room ID (id), most recent activity (lastactivity), or most recently created (created).
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the rooms returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
create(title, teamId=None, **request_parameters)[source]

Create a room.

The authenticated user is automatically added as a member of the room.

Parameters:
  • title (basestring) – A user-friendly name for the room.
  • teamId (basestring) – The team ID with which this room is associated.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Room with the details of the created room.

Return type:

Room

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(roomId)[source]

Get the details of a room, by ID.

Parameters:

roomId (basestring) – The ID of the room to be retrieved.

Returns:

A Room object with the details of the requested room.

Return type:

Room

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get_meeting_info(roomId)[source]

Get the meeting details for a room.

Parameters:

roomId (basestring) – The unique identifier for the room.

Returns:

A Room Meeting Info object with the meeting details for the room such as the SIP address, meeting URL, toll-free and toll dial-in numbers.

Return type:

RoomMeetingInfo

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
update(roomId, title, **request_parameters)[source]

Update details for a room, by ID.

Parameters:
  • roomId (basestring) – The room ID.
  • title (basestring) – A user-friendly name for the room.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Room object with the updated Webex Teams room details.

Return type:

Room

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
delete(roomId)[source]

Delete a room.

Parameters:

roomId (basestring) – The ID of the room to be deleted.

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

teams

class TeamsAPI[source]

Webex Teams Teams API.

Wraps the Webex Teams Teams API and exposes the API as native Python methods that return native Python objects.

list(max=100, **request_parameters)[source]

List teams to which the authenticated user belongs.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all teams returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the teams returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
create(name, **request_parameters)[source]

Create a team.

The authenticated user is automatically added as a member of the team.

Parameters:
  • name (basestring) – A user-friendly name for the team.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Team object with the details of the created team.

Return type:

Team

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(teamId)[source]

Get the details of a team, by ID.

Parameters:

teamId (basestring) – The ID of the team to be retrieved.

Returns:

A Team object with the details of the requested team.

Return type:

Team

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
update(teamId, name, **request_parameters)[source]

Update details for a team, by ID.

Parameters:
  • teamId (basestring) – The team ID.
  • name (basestring) – A user-friendly name for the team.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Team object with the updated Webex Teams team details.

Return type:

Team

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
delete(teamId)[source]

Delete a team.

Parameters:

teamId (basestring) – The ID of the team to be deleted.

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

team_memberships

class TeamMembershipsAPI[source]

Webex Teams Team-Memberships API.

Wraps the Webex Teams Memberships API and exposes the API as native Python methods that return native Python objects.

list(teamId, max=100, **request_parameters)[source]

List team memberships for a team, by ID.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all team memberships returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • teamId (basestring) – List team memberships for a team, by ID.
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the team memberships returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
create(teamId, personId=None, personEmail=None, isModerator=False, **request_parameters)[source]

Add someone to a team by Person ID or email address.

Add someone to a team by Person ID or email address; optionally making them a moderator.

Parameters:
  • teamId (basestring) – The team ID.
  • personId (basestring) – The person ID.
  • personEmail (basestring) – The email address of the person.
  • isModerator (bool) – Set to True to make the person a team moderator.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A TeamMembership object with the details of the created team membership.

Return type:

TeamMembership

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(membershipId)[source]

Get details for a team membership, by ID.

Parameters:

membershipId (basestring) – The team membership ID.

Returns:

A TeamMembership object with the details of the requested team membership.

Return type:

TeamMembership

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
update(membershipId, isModerator=None, **request_parameters)[source]

Update a team membership, by ID.

Parameters:
  • membershipId (basestring) – The team membership ID.
  • isModerator (bool) – Set to True to make the person a team moderator.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A TeamMembership object with the updated Webex Teams team-membership details.

Return type:

TeamMembership

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
delete(membershipId)[source]

Delete a team membership, by ID.

Parameters:

membershipId (basestring) – The team membership ID.

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

webhooks

class WebhooksAPI[source]

Webex Teams Webhooks API.

Wraps the Webex Teams Webhooks API and exposes the API as native Python methods that return native Python objects.

list(max=100, **request_parameters)[source]

List all of the authenticated user’s webhooks.

This method supports Webex Teams’s implementation of RFC5988 Web Linking to provide pagination support. It returns a generator container that incrementally yields all webhooks returned by the query. The generator will automatically request additional ‘pages’ of responses from Webex as needed until all responses have been returned. The container makes the generator safe for reuse. A new API call will be made, using the same parameters that were specified when the generator was created, every time a new iterator is requested from the container.

Parameters:
  • max (int) – Limit the maximum number of items returned from the Webex Teams service per request.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A GeneratorContainer which, when iterated, yields the webhooks returned by the Webex Teams query.

Return type:

GeneratorContainer

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
create(name, targetUrl, resource, event, filter=None, secret=None, **request_parameters)[source]

Create a webhook.

Parameters:
  • name (basestring) – A user-friendly name for this webhook.
  • targetUrl (basestring) – The URL that receives POST requests for each event.
  • resource (basestring) – The resource type for the webhook.
  • event (basestring) – The event type for the webhook.
  • filter (basestring) – The filter that defines the webhook scope.
  • secret (basestring) – The secret used to generate payload signature.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Webhook object with the details of the created webhook.

Return type:

Webhook

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
get(webhookId)[source]

Get the details of a webhook, by ID.

Parameters:

webhookId (basestring) – The ID of the webhook to be retrieved.

Returns:

A Webhook object with the details of the requested webhook.

Return type:

Webhook

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
update(webhookId, name=None, targetUrl=None, **request_parameters)[source]

Update a webhook, by ID.

Parameters:
  • webhookId (basestring) – The webhook ID.
  • name (basestring) – A user-friendly name for this webhook.
  • targetUrl (basestring) – The URL that receives POST requests for each event.
  • **request_parameters – Additional request parameters (provides support for parameters that may be added in the future).
Returns:

A Webhook object with the updated Webex Teams webhook

details.

Return type:

Webhook

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.
delete(webhookId)[source]

Delete a webhook, by ID.

Parameters:

webhookId (basestring) – The ID of the webhook to be deleted.

Raises:
  • TypeError – If the parameter types are incorrect.
  • ApiError – If the Webex Teams cloud returns an error.

Webex Teams Data Objects

Access Token

class AccessToken[source]

Webex Teams Access-Token data model.

access_token

Webex Teams access token.

expires_in

Access token expiry time (in seconds).

json_data

A copy of the data object’s JSON data (OrderedDict).

refresh_token

Refresh token used to request a new/refreshed access token.

refresh_token_expires_in

Refresh token expiry time (in seconds).

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Admin Audit Event

class AdminAuditEvent[source]

Webex Teams Admin Audit Event data model.

data

The event resource data.

actorId

The personId of the person who made the change.

created

The date and time the event took place.

id

A unique identifier for the event.

json_data

A copy of the data object’s JSON data (OrderedDict).

orgId

The orgId of the person who made the change.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Attachment Action

class AttachmentAction[source]

Webex Attachment Actions data model

created

The date and time the action was created.

id

A unique identifier for the action.

inputs

The attachment action’s inputs

json_data

A copy of the data object’s JSON data (OrderedDict).

messageId

The parent message the attachment action was performed on.

personId

The ID of the person who performed the action.

roomId

The ID of the room the action was performed within.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

type

The type of action performed.

Attachment action enum:
‘submit’: submit filled in inputs

Event

class Event[source]

Webex Teams Event data model.

data

The event’s data representation.

This object will contain the event’s resource, such as memberships or messages, at the time the event took place.

actorId

The ID of the person who performed the action.

appId

The ID of the application for the event.

created

The date and time of the event.

id

The unique identifier for the event.

json_data

A copy of the data object’s JSON data (OrderedDict).

orgId

The ID of the organization for the event.

resource

The type of resource in the event.

Event Resource Enum:
messages memberships
to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

type

The action which took place in the event.

Event Type Enum:
created updated deleted

Guest Issuer Token

class GuestIssuerToken[source]

Webex Teams Guest Issuer Token data model

expiresIn
json_data

A copy of the data object’s JSON data (OrderedDict).

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

token

License

class License[source]

Webex Teams License data model.

consumedUnits

Total number of license units consumed.

id

A unique identifier for the license.

json_data

A copy of the data object’s JSON data (OrderedDict).

name

Name of the licensed feature.

siteType

The type of site associated with this license.

Control Hub managed site the site is managed by Webex Control Hub.

Linked site the site is a linked site

Site Admin managed site the site is managed by Site Administration

siteUrl

The Webex Meetings site associated with this license.

subscriptionId

The subscription ID associated with this license.

This ID is used in other systems, such as Webex Control Hub.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

totalUnits

Total number of license units allocated.

Membership

class Membership[source]

Webex Teams Membership data model.

created

The date and time when the membership was created.

id

A unique identifier for the membership.

isModerator

Whether or not the participant is a room moderator.

isMonitor

Whether or not the participant is a monitoring bot (deprecated).

json_data

A copy of the data object’s JSON data (OrderedDict).

personDisplayName

The display name of the person.

personEmail

The email address of the person.

personId

The person ID.

personOrgId

The organization ID of the person.

roomId

The room ID.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Message

class Message[source]

Webex Teams Message data model.

attachments

Message content attachments attached to the message.

created

The date and time the message was created.

files

Public URLs for files attached to the message.

html

The text content of the message, in HTML format.

This read-only property is used by the Webex Teams clients.

id

The unique identifier for the message.

json_data

A copy of the data object’s JSON data (OrderedDict).

markdown

The message, in Markdown format.

mentionedGroups

Group names for the groups mentioned in the message.

mentionedPeople

People IDs for anyone mentioned in the message.

parentId

The unique identifier for the parent message.

personEmail

The email address of the message author.

personId

The person ID of the message author.

roomId

The room ID of the message.

roomType

The type of room.

Room Type Enum:
direct: 1:1 room group: Group room
text

The message, in plain text.

toPersonEmail

1 message.

Type:The email address of the recipient when sending a 1
toPersonId

1 message.

Type:The person ID of the recipient when sending a 1
to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

updated

The date and time the message was created.

Organization

class Organization[source]

Webex Teams Organization data model.

created

The date and time the organization was created.

displayName

Full name of the organization.

id

A unique identifier for the organization.

json_data

A copy of the data object’s JSON data (OrderedDict).

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Person

class Person[source]

Webex Teams Person data model.

avatar

The URL to the person”s avatar in PNG format.

created

The date and time the person was created.

displayName

The full name of the person.

emails

The email addresses of the person.

firstName

The first name of the person.

id

A unique identifier for the person.

invitePending

Whether or not an invite is pending for the user to complete account activation.

Person Invite Pending Enum:
true: The person has been invited to Webex Teams but has not
created an account

false: An invite is not pending for this person

json_data

A copy of the data object’s JSON data (OrderedDict).

lastActivity

The date and time of the person”s last activity within Webex Teams.

lastModified

The date and time the person was last changed.

lastName

The last name of the person.

licenses

An array of license strings allocated to this person.

loginEnabled

Whether or not the user is allowed to use Webex Teams.

Person Login Enabled Enum:

true: The person can log into Webex Teams

“false”: The person cannot log into Webex Teams

nickName

The nickname of the person if configured.

If no nickname is configured for the person, this field will not be present.

orgId

The ID of the organization to which this person belongs.

phoneNumbers()

Phone numbers for the person.

roles

An array of role strings representing the roles to which this person belongs.

status

The current presence status of the person.

Person Status Enum:

active: Active within the last 10 minutes

call: The user is in a call

DoNotDisturb: The user has manually set their status to
“Do Not Disturb”

inactive: Last activity occurred more than 10 minutes ago

meeting: The user is in a meeting

OutOfOffice: The user or a Hybrid Calendar service has indicated
that they are “Out of Office”
pending: The user has never logged in; a status cannot be
determined

presenting: The user is sharing content

unknown: The user’s status could not be determined

timezone

The time zone of the person if configured.

If no timezone is configured on the account, this field will not be present.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

type

The type of person account, such as person or bot.

Person Type Enum:
person: Account belongs to a person bot: Account is a bot user appuser: Account is a guest user

Role

class Role[source]

Webex Teams Role data model.

id

A unique identifier for the role.

json_data

A copy of the data object’s JSON data (OrderedDict).

name

The name of the role.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Room

class Room[source]

Webex Teams Room data model.

created

The date and time the room was created.

creatorId

The ID of the person who created this room.

id

A unique identifier for the room.

isLocked

Whether the room is moderated (locked) or not.

json_data

A copy of the data object’s JSON data (OrderedDict).

lastActivity

The date and time of the room”s last activity.

ownerId

The ID of the organization which owns this room.

teamId

The ID for the team with which this room is associated.

title

A user-friendly name for the room.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

type

The room type.

Room Type Enum:

direct: 1:1 room

group: Group room

Room Meeting Info

class RoomMeetingInfo[source]

Webex Teams Room Meeting Info data model.

callInTollFreeNumber

The toll-free PSTN number for the room.

callInTollNumber

The toll (local) PSTN number for the room.

json_data

A copy of the data object’s JSON data (OrderedDict).

The Webex meeting URL for the room.

meetingNumber

The Webex meeting number for the room.

roomId

A unique identifier for the room.

sipAddress

The SIP address for the room.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Team

class Team[source]

Webex Teams Team data model.

created

The date and time the team was created.

creatorId

The ID of the person who created the team.

id

A unique identifier for the team.

json_data

A copy of the data object’s JSON data (OrderedDict).

name

A user-friendly name for the team.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Team Membership

class TeamMembership[source]

Webex Teams Team-Membership data model.

created

The date and time when the team membership was created.

id

A unique identifier for the team membership.

isModerator

Whether or not the participant is a team moderator.

json_data

A copy of the data object’s JSON data (OrderedDict).

personDisplayName

The display name of the person.

personEmail

The email address of the person.

personId

The person ID.

personOrgId

The organization ID of the person.

teamId

The team ID.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Webhook

class Webhook[source]

Webex Teams Webhook data model.

appId

The ID of the application that created the webhook.

created

The date and time the webhook was created.

createdBy

The ID of the person that created the webhook.

event

The event type for the webhook.

Webhook Event Type Enum:
all: Subscribe to all events created: An object was created updated: An object was updated deleted: An object was deleted
filter

The filter that defines the webhook scope.

id

A unique identifier for the webhook.

json_data

A copy of the data object’s JSON data (OrderedDict).

name

A user-friendly name for the webhook.

orgId

The ID of the organization that owns the webhook.

ownedBy

Indicates if the webhook is owned by the org or the creator.

Webhooks owned by the creator can only receive events that are accessible to the creator of the webhook. Those owned by the organization will receive events that are visible to anyone in the organization.

Webhook Owned By Enum:
org creator
resource

The resource type for the webhook.

Creating a webhook requires ‘read’ scope on the resource the webhook is for.

Webhook Resource Enum:
all: Subscribe to all resources memberships: The Memberships resource messages: The Messages resource rooms: The Rooms resource
secret

The secret used to generate payload signature.

status

The status of the webhook.

Webhook Status Enum:
active: The webhook is active inactive: The webhook is inactive
targetUrl

The URL that receives POST requests for each event.

to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Webhook Event

class WebhookEvent[source]

Webex Teams Webhook-Events data model.

data

The event resource data.

actorId

The ID of the person that caused the webhook to be sent.

appId

The ID of the application that created the webhook.

createdBy

The ID of the person that created the webhook.

event

The event type for the webhook.

Webhook Event Type Enum:
created: An object was created updated: An object was updated deleted: An object was deleted
filter

The filter that defines the webhook scope.

id

A unique identifier for the webhook.

json_data

A copy of the data object’s JSON data (OrderedDict).

name

A user-friendly name for the webhook.

orgId

The ID of the organization that owns the webhook.

ownedBy

Indicates if the webhook is owned by the org or the creator.

Webhooks owned by the creator can only receive events that are accessible to the creator of the webhook. Those owned by the organization will receive events that are visible to anyone in the organization.

Webhook Owned By Enum:
org creator
resource

The resource type for the webhook.

Creating a webhook requires ‘read’ scope on the resource the webhook is for.

Webhook Resource Enum:
memberships: The Memberships resource messages: The Messages resource rooms: The Rooms resource
status

The status of the webhook.

Webhook Status Enum:
active: The webhook is active inactive: The webhook is inactive
to_dict()

Convert the Webex Teams object data to a dictionary.

to_json(**kwargs)

Convert the Webex Teams object data to JSON.

Any keyword arguments provided are passed through the Python JSON encoder.

Exceptions

exception webexteamssdkException[source]

Bases: Exception

Base class for all webexteamssdk package exceptions.

exception AccessTokenError[source]

Bases: webexteamssdk.exceptions.webexteamssdkException

Raised when an incorrect Webex Teams Access Token has been provided.

exception ApiError[source]

Bases: webexteamssdk.exceptions.webexteamssdkException

Errors returned in response to requests sent to the Webex Teams APIs.

Several data attributes are available for inspection.

response = None

The requests.Response object returned from the API call.

request = None

The requests.PreparedRequest of the API call.

status_code = None

The HTTP status code from the API response.

status = None

The HTTP status from the API response.

description = None

A description of the HTTP Response Code from the API docs.

details = None

The parsed JSON details from the API response.

message = None

The error message from the parsed API response.

tracking_id = None

The Webex Tracking ID from the response.

exception MalformedResponse[source]

Bases: webexteamssdk.exceptions.webexteamssdkException

Raised when a malformed response is received from Webex Teams.

exception RateLimitError[source]

Bases: webexteamssdk.exceptions.ApiError

Webex Teams Rate-Limit exceeded Error.

Raised when a rate-limit exceeded message is received and the request will not be retried.

retry_after = None

The Retry-After time period (in seconds) provided by Webex Teams.

Defaults to 15 seconds if the response Retry-After header isn’t present in the response headers, and defaults to a minimum wait time of 1 second if Webex Teams returns a Retry-After header of 0 seconds.

Warnings

exception webexteamssdkWarning[source]

Bases: webexteamssdk.exceptions.webexteamssdkException, Warning

Base class for all webexteamssdk warnings.

exception ApiWarning[source]

Bases: webexteamssdk.exceptions.webexteamssdkWarning, webexteamssdk.exceptions.ApiError

Warnings raised from API responses received from the Webex APIs.

Several data attributes are available for inspection.

exception RateLimitWarning[source]

Bases: webexteamssdk.exceptions.ApiWarning, webexteamssdk.exceptions.RateLimitError

Webex Teams rate-limit exceeded warning.

Raised when a rate-limit exceeded message is received and the request will be retried.

Cards and Buttons

class AdaptiveCard

Adaptive Card data model.

Note: Webex Teams currently supports version 1.1 of adaptive cards and thus only features from that release are supported in this abstraction.

type = 'AdaptiveCard'
schema = 'http://adaptivecards.io/schemas/adaptive-card.json'
version = '1.1'
to_dict()

Serialize the component into a Python dictionary.

The to_dict() method recursively serializes the object’s data into a Python dictionary.

Returns:Dictionary representation of this component.
Return type:dict

Components

class Image

Adaptive Card Image component.

__init__(url, altText=None, backgroundColor=None, height=None, horizontalAlignment=None, selectAction=None, size=None, style=None, width=None, separator=None, spacing=None, id=None)

Initialize a new image component.

Parameters:
  • url (str) – The URL to the image
  • altText (str) – Alternative text describing the image
  • backgroundColor (str) – Background color for transparent images.
  • height (str, BlockElementHeight) – Height of the image either as a pixel value(i.e. ‘50px’) or as an instance of BlockElementHeight
  • horizontalAlignmnet (HorizontalAlignment) – Controls how the component is positioned within its parent.
  • selectAction (OpenUrl, Submit) – Option that is carried out when the card is selected.
  • size (ImageSize) – Controls the approximate size of the image.
  • style (ImageStyle) – The display style of this image.
  • width (str) – Width of the image as a pixel value (i.e. ‘50px’)
  • separator (bool) – Draw a separating line when set to true
  • spacing (Spacing) – Specify the spacing of this component
  • id (str) – The id of this component
type = 'Image'
class TextBlock

Adaptive Card Text Block component.

__init__(text, color=None, horizontalAlignment=None, isSubtle=None, maxLines=None, size=None, weight=None, wrap=None, separator=None, spacing=None, id=None)

Initialize a new TextBlock component.

type = 'TextBlock'
class Column

Adaptive Card Column component.

type = 'Column'
class Fact

Adaptive Card Fact component.

class Choice

Options

class VerticalContentAlignment

An enumeration.

TOP = 'top'
CENTER = 'center'
BOTTOM = 'bottom'
class Colors

An enumeration.

DEFAULT = 'default'
DARK = 'dark'
LIGHT = 'light'
ACCENT = 'accent'
GOOD = 'good'
WARNING = 'warning'
ATTENTION = 'attention'
class HorizontalAlignment

An enumeration.

LEFT = 'left'
CENTER = 'center'
RIGHT = 'right'
class FontSize

An enumeration.

DEFAULT = 'default'
SMALL = 'small'
MEDIUM = 'medium'
LARGE = 'large'
EXTRA_LARGE = 'extraLarge'
class FontWeight

An enumeration.

DEFAULT = 'default'
LIGHTER = 'lighter'
BOLDER = 'bolder'
class BlockElementHeight

An enumeration.

AUTO = 'auto'
STRETCH = 'auto'
class Spacing

An enumeration.

DEFAULT = 'default'
NONE = 'none'
SMALL = 'small'
MEDIUM = 'medium'
LARGE = 'large'
EXTRA_LARGE = 'extraLarge'
PADDING = 'padding'
class ImageSize

An enumeration.

AUTO = 'auto'
STRETCH = 'stretch'
SMALL = 'small'
MEDIUM = 'medium'
LARGE = 'large'
class ImageStyle

An enumeration.

DEFAULT = 'default'
PERSON = 'person'
class ContainerStyle

An enumeration.

DEFAULT = 'default'
EMPHASIS = 'emphasis'
class TextInputStyle

An enumeration.

TEXT = 'text'
TEL = 'tel'
URL = 'url'
EMAIL = 'email'
class ChoiceInputStyle

An enumeration.

COMPACT = 'compact'
EXPANDED = 'expanded'

Container

class Container

Adaptive Card Container component.

type = 'Container'
class ColumnSet

Adaptive Card Column Set component.

type = 'ColumnSet'
class FactSet

Adaptive Card Fact Set component.

type = 'FactSet'
class ImageSet

Adaptive Card Image Set component.

type = 'ImageSet'

Inputs

class Text

Adaptive Card Text component.

type = 'Input.Text'
class Number

Adaptive Card Number component.

type = 'Input.Number'
class Date

Adaptive Card Date component.

type = 'Input.Date'
class Time

Adaptive Card Time component.

type = 'Input.Time'
class Toggle

Adaptive Card Toggle component.

type = 'Input.Toggle'
class Choices

Adaptive Card Choice Set component.

type = 'Input.ChoiceSet'

Actions

class OpenUrl(url, title=None, iconURL=None)

Open URL Action.

type = 'Action.OpenUrl'
class Submit(data=None, title=None, iconURL=None)

Submit Action.

type = 'Action.Submit'
class ShowCard(card=None, title=None, iconURL=None)

Show Card Action.

type = 'Action.ShowCard'

Copyright (c) 2016-2020 Cisco and/or its affiliates.