wxc_sdk.rooms package

Rooms API

class wxc_sdk.rooms.Room(*, id: str | None = None, title: str | None = None, type: RoomType | None = None, isLocked: bool | None = None, teamId: str | None = None, lastActivity: datetime | None = None, creatorId: str | None = None, created: datetime | None = None, ownerId: str | None = None, classificationId: str | None = None, isAnnouncementOnly: bool | None = None, isReadOnly: bool | None = None, isPublic: bool | None = None, madePublic: datetime | None = None, description: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

id: str | None

A unique identifier for the room.

title: str | None

A user-friendly name for the room.

type: RoomType | None

The room type.

is_locked: bool | None

Whether the room is moderated (locked) or not.

team_id: str | None

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

last_activity: datetime | None

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

creator_id: str | None

The ID of the person who created this room.

created: datetime | None

The date and time the room was created.

owner_id: str | None

The ID of the organization which owns this room. See Webex Data in the `Compliance Guide

classification_id: str | None

Space classification ID represents the space’s current classification. It can be attached during space creation time, and can be modified at the request of an authorized user.

is_announcement_only: bool | None

Indicates when a space is in Announcement Mode where only moderators can post messages

is_read_only: bool | None

A compliance officer can set a direct room as read-only, which will disallow any new information exchanges in this space, while maintaing historical data.

is_public: bool | None

The room is public and therefore discoverable within the org. Anyone can find and join that room.

made_public: datetime | None

Date and time when the room was made public.

description: str | None

The description of the space.

class wxc_sdk.rooms.RoomsApi(*, session: RestSession, base: str = None)[source]

Bases: ApiChild

Rooms are virtual meeting places where people post messages and collaborate to get work done. This API is used to manage the rooms themselves. Rooms are created and deleted with this API. You can also update a room to change its title, for example. To create a team room, specify the a teamId in the POST payload. Note that once a room is added to a team, it cannot be moved. To learn more about managing teams, see the Teams API. To manage people in a room see the Memberships API. To post content see the Messages API.

list(team_id: str = None, type_: RoomType = None, org_public_spaces: bool = None, from_: str | datetime = None, to_: str | datetime = None, sort_by: str = None, **params: Any) Generator[Room, None, None][source]

List rooms.

The title of the room for 1:1 rooms will be the display name of the other person. By default, lists rooms to which the authenticated user belongs.

Long result sets will be split into pages.

Known Limitations:

The underlying database does not support natural sorting by lastactivity and will only sort on limited set of results, which are pulled from the database in order of roomId. For users or bots in more than 3000 spaces this can result in anomalies such as spaces that have had recent activity not being returned in the results when sorting by lastacivity.

Parameters:
  • team_id (str) – List rooms associated with a team, by ID.

  • type (RoomType) – List rooms by type. Possible values: direct, group

  • org_public_spaces (bool) – Shows the org’s public spaces joined and unjoined. When set the result list is sorted by the madePublic timestamp.

  • from (Union[str, datetime]) – Filters rooms, that were made public after this time. See madePublic timestamp

  • to (Union[str, datetime]) – Filters rooms, that were made public before this time. See maePublic timestamp

  • sort_by (str) – Sort results. Possible values: id, lastactivity, created

Returns:

Generator yielding Room instances

create(title: str, team_id: str = None, classification_id: str = None, is_locked: bool = None, is_public: bool = None, description: str = None, is_announcement_only: bool = None) Room[source]

Create a Room

Creates a room. The authenticated user is automatically added as a member of the room. See the Memberships API to learn how to add more people to the room.

To create a 1:1 room, use the Create Messages endpoint to send a message directly to another person by using the toPersonId or toPersonEmail parameters.

Bots are not able to create and simultaneously classify a room. A bot may update a space classification after a person of the same owning organization joined the space as the first human user. A space can only be put into announcement mode when it is locked.

Parameters:
  • title (str) – A user-friendly name for the room.

  • team_id (str) – The ID for the team with which this room is associated.

  • classification_id (str) – The classificationId for the room.

  • is_locked (bool) – Set the space as locked/moderated and the creator becomes a moderator

  • is_public (bool) – The room is public and therefore discoverable within the org. Anyone can find and join that room. When true the description must be filled in.

  • description (str) – The description of the space.

  • is_announcement_only (bool) – Sets the space into announcement Mode.

Return type:

Room

details(room_id: str) Room[source]

Get Room Details

Shows details for a room, by ID.

The title of the room for 1:1 rooms will be the display name of the other person. When a Compliance Officer lists 1:1 rooms, the “other” person cannot be determined. This means that the room’s title may not be filled in and instead shows “Empty Title”. Please use the memberships API to list the other person in the space.

Specify the room ID in the roomId parameter in the URI.

Parameters:

room_id (str) – The unique identifier for the room.

Return type:

Room

update(update: Room) Room[source]

Updates details for a room, by ID.

Specify the room ID in the roomId parameter in the URI.

A space can only be put into announcement mode when it is locked.

Any space participant or compliance officer can convert a space from public to private. Only a compliance officer can convert a space from private to public and only if the space is classified with the lowest category (usually public), and the space has a description.

To remove a description please use a space character ` ` by itself.

When using this method for moving a space under a team, ensure that all moderators in the space are also team members. If a moderator is not part of the team, demote or remove them as a moderator. Alternatively, add the non-team moderators to the team. This ensures compliance with the requirement that all space moderators must be team members for successful operation execution.

Update:

update to apply. ID and title have to be set. Only can update:

Return type:

Room

delete(room_id: str) None[source]

Delete a Room

Deletes a room, by ID. Deleted rooms cannot be recovered. As a security measure to prevent accidental deletion, when a non moderator deletes the room they are removed from the room instead.

Deleting a room that is part of a team will archive the room instead.

A Compliance Officer has no special privileges, i.e. they cannot delete rooms they are not part of.

Specify the room ID in the roomId parameter in the URI.

Parameters:

room_id (str) – The unique identifier for the room.

Return type:

None

base = 'rooms'