wxc_sdk.licenses package

Licenses

An allowance for features and services that are provided to users on a Webex services subscription. Cisco and its partners manage the amount of licenses provided to administrators and users. This license resource can be accessed only by an admin.

class wxc_sdk.licenses.SiteType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

Webex site type

control_hub_managed_site = 'Control Hub managed site'

The site is managed by Webex Control Hub.

linked_site = 'Linked site'

The site is a linked site.

site_admin_managed_site = 'Site Admin managed site'

The site is managed by Site Administration.

class wxc_sdk.licenses.License(*, id: str, name: str, totalUnits: int, consumedUnits: int, consumedByUsers: int | None = None, consumedByWorkspaces: int | None = None, subscriptionId: str | None = None, siteUrl: str | None = None, siteType: SiteType | None = None, **extra_data: Any)[source]

Bases: ApiModel

Webex license

license_id: str

A unique identifier for the license.

name: str

Name of the licensed feature.

total_units: int

Total number of license units allocated.

consumed_units: int

Total number of license units consumed.

consumed_by_users: int | None

Total number of license units consumed by users.

consumed_by_workspaces: int | None

Total number of license units consumed by workspaces.

subscription_id: str | None

The subscription ID associated with this license. This ID is used in other systems, such as Webex Control Hub.

site_url: str | None

The Webex Meetings site associated with this license.

site_type: SiteType | None

The type of site associated with this license.

property webex_calling: bool

is this a Webex Calling license

property webex_calling_professional: bool

is this a Webex Calling professional license

property webex_calling_basic: bool

is this a Webex Calling basic license

property webex_calling_workspaces: bool

is this a Webex Calling workspace license

property cx_essentials: bool

is this a Customer Experience Essentials license

property lic_type: str

base64 decoded license id looks something like this: <org uuid>:<lic type>_<lic uuid>

property lic_uuid: str

base64 decoded license id looks something like this: <org uuid>:<lic type>_<lic uuid>

class wxc_sdk.licenses.LicensesApi(*, session: RestSession, base: str | None = None)[source]

Bases: ApiChild

Licenses

An allowance for features and services that are provided to users on a Webex services subscription. Cisco and its partners manage the amount of licenses provided to administrators and users. License can be assigned only by admins.

Viewing the list of all licenses in your organization and viewing license details requires an administrator auth token with a scope of spark-admin:licenses_read.

Updating the licenses of users requires an administrator auth token with a scope of spark-admin:people_write.

The license assignment API now supports partial success scenarios. When assigning multiple licenses to a user, if some licenses can be assigned successfully while others fail due to constraints or conflicts, the API returns a 206 Partial Content status code instead of failing the entire request. This allows for more robust bulk license operations, providing detailed information about which licenses were assigned successfully and which failed, along with specific error details for each failure. Previously, if any single license in a batch could not be assigned, the entire request would fail.

To learn about how to allocate Hybrid Services licenses, see the Managing Hybrid Services guide.

list(org_id: str | None = None) list[License][source]

List all licenses for a given organization. If no org_id is specified, the default is the organization of the authenticated user.

Response properties that are not applicable to the license will not be present in the response.

Parameters:

org_id (str) – List licenses for this organization.

Returns:

yields License instances

details(license_id) License[source]

Shows details for a license, by ID.

Response properties that are not applicable to the license will not be present in the response.

Parameters:

license_id (str) – The unique identifier for the license.

Returns:

license details

Return type:

License

assigned_users(license_id: str, **params) Generator[LicenseUser, None, None][source]

Get users license is assigned to, by license ID.

Specify the license ID in the licenseId parameter in the URI. Long result sets will be split into pages.

Parameters:

license_id (str) – The unique identifier for the license.

assign_licenses_to_users(email: str | None = None, person_id: str | None = None, licenses: list[LicenseRequest] | None = None, site_urls: list[SiteUrlsRequest] | None = None, org_id: str | None = None) UserLicensesResponse[source]

Assign Licenses to Users

Assign licenses and attendee siteUrls to existing users. Only an admin can assign licenses. Only existing users can be assigned a license. Assign meeting licenses to users outside your organization (Status will be pending until the user accepts the invite)

At least one of the following body parameters is required to assign license to the user: email, personId. For Calling license assignment, properties phoneNumber or extension are required. If phoneNumber is not provided then locationId is mandatory.

When assigning licenses and attendee siteUrls to a user who does not belong to the organization, the licenses and siteUrls remain in pending state until the user accepts them. The pendingLicenses and pendingSiteUrls are part of the response.

Parameters:
  • email (str) – Email address of the user.

  • person_id (str) – A unique identifier for the user.

  • licenses (list[LicenseRequest]) – An array of licenses to be assigned to the user.

  • site_urls (list[SiteUrlsRequest]) – An array of siteUrls to be assigned to the user.

  • org_id (str) – The ID of the organization to which the licenses and siteUrls belong. If not specified, the organization ID from the OAuth token is used.

Return type:

UserLicensesResponse

Example

self.api.licenses.assign_licenses_to_users(
    person_id=new_user.person_id,
    licenses=[LicenseRequest(id=calling_license_id,
                             properties=LicenseProperties(location_id=target_location.location_id,
                                                          extension=extension))])
base = 'licenses'
class wxc_sdk.licenses.LicenseUser(*, id: str | None = None, type: LicenseUserType | None = None, displayName: str | None = None, email: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

id: str | None

A unique identifier for the user.

type: LicenseUserType | None

Indicates if the user is internal or external to the organization.

display_name: str | None

The full name of the user.

email: str | None

Email address of the user.

class wxc_sdk.licenses.LicenseUserType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

internal = 'INTERNAL'

User resides in the license-owned organization.

external = 'EXTERNAL'

User resides outside the license-owned organization.

class wxc_sdk.licenses.LicenseRequestOperation(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

remove = 'remove'

Remove the license from the user

add = 'add'

Assign the license to the user

class wxc_sdk.licenses.LicenseProperties(*, locationId: str | None = None, phoneNumber: str | None = None, extension: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

location_id: str | None

The ID of the location for this user. Applicable to Webex Calling license.

phone_number: str | None

Work phone number for the user. Applicable to Webex Calling license.

extension: str | None

Webex Calling extension of the user. Applicable to Webex Calling license.

class wxc_sdk.licenses.LicenseRequest(*, id: str | None = None, operation: LicenseRequestOperation | None = None, properties: LicenseProperties | None = None, **extra_data: Any)[source]

Bases: ApiModel

id: str | None

A unique identifier for the license.

operation: LicenseRequestOperation | None

Operation type. The default operation is add if no operation is specified.

properties: LicenseProperties | None

Properties for the license. Either phoneNumber or extension are mandatory for assigning Webex Calling licenses. If phoneNumber is not provided then locationId is mandatory.

class wxc_sdk.licenses.SiteAccountType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

attendee = 'attendee'

Attendee account on the site.

host = 'host'

Host account on the site.

class wxc_sdk.licenses.SiteUrlsRequest(*, siteUrl: str | None = None, accountType: SiteAccountType | None = None, operation: LicenseRequestOperation | None = None, **extra_data: Any)[source]

Bases: ApiModel

site_url: str | None

Attendee access on the site.

account_type: SiteAccountType | None

Account type. Only attendee type is supported. For host account, remove attendee and assign the license on that site.

operation: LicenseRequestOperation | None

Operation type. The default operation is add if no operation is specified.

class wxc_sdk.licenses.SiteResponse(*, siteUrl: str | None = None, accountType: SiteAccountType | None = None, **extra_data: Any)[source]

Bases: ApiModel

site_url: str | None

siteUrl assigned to the user.

account_type: SiteAccountType | None

Account Type of the site.

class wxc_sdk.licenses.UserLicensesResponse(*, orgId: str | None = None, personId: str | None = None, email: str | None = None, licenses: list[str] | None = None, siteUrls: list[SiteResponse] | None = None, pendingLicenses: list[str] | None = None, pendingSiteUrls: list[SiteResponse] | None = None, **extra_data: Any)[source]

Bases: ApiModel

org_id: str | None

The ID of the organization to which this user belongs.

person_id: str | None

A unique identifier for the user.

email: str | None

The email address of this user.

licenses: list[str] | None
site_urls: list[SiteResponse] | None

An array of siteUrls and their accountType that are assigned to this user.

pending_licenses: list[str] | None

An array of license strings that are in pending state. This is only applicable to users outside the organization.

pending_site_urls: list[SiteResponse] | None

An array of siteUrls and their accountType that are in pending state. This is only applicable to users outside the organization.