wxc_sdk.locations package

Locations

Locations are used to organize Webex Calling (BroadCloud) features within physical locations. Webex Control Hub may be used to define new locations.

Searching and viewing locations in your organization requires an administrator auth token with the spark-admin:people_read and spark-admin:people_write or spark-admin:device_read AND spark-admin:device_writescope combinations.

class wxc_sdk.locations.LocationAddress(*, address1: str, address2: str = None, city: str, state: str, postalCode: str, country: str = None)[source]

Bases: ApiModel

Address of a Location

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

address1: str

address line 1

address2: Optional[str]

address line 2

city: str

city

state: str

state

postal_code: str

ZIP/Postal code

country: Optional[str]

country

class wxc_sdk.locations.Location(*, id: str = None, name: str = None, orgId: str = None, address: LocationAddress = None, timeZone: str = None, preferredLanguage: str = None)[source]

Bases: ApiModel

Webex location

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

location_id: Optional[str]

A unique identifier for the location.

name: Optional[str]

The name of the location.

org_id: Optional[str]

The ID of the organization to which this location belongs.

address: Optional[LocationAddress]

The address of the location, LocationAddress

time_zone: Optional[str]
preferred_language: Optional[str]
property location_id_uuid: str

location id as UUID

property org_id_uuid: str

org id as UUID

class wxc_sdk.locations.LocationsApi(*, session: RestSession, base: Optional[str] = None)[source]

Bases: ApiChild

Location API

Locations are used to organize Webex Calling (BroadCloud) features within physical locations. Webex Control Hub may be used to define new locations.

Searching and viewing locations in your organization requires an administrator auth token with the spark-admin:people_read and spark-admin:people_write or spark-admin:device_read AND spark-admin:device_write scope combinations.

list(name: Optional[str] = None, location_id: Optional[str] = None, org_id: Optional[str] = None, **params) Generator[Location, None, None][source]

List locations for an organization.

Parameters
  • name (str) – List locations whose name contains this string (case-insensitive).

  • location_id (str) – List locations by ID.

  • org_id (str) – List locations in this organization. Only admin users of another organization (such as partners) may use this parameter.

Returns

generator of Location instances

by_name(name: str, org_id: Optional[str] = None) Optional[Location][source]

Get a location by name

Parameters
  • name (str) – name of the location to search

  • org_id (str) – search in list of locations in this organization. Only admin users of another organization (such as partners) may use this parameter.

Returns

locations

Return type

Location

details(location_id) Location[source]

Shows details for a location, by ID.

This API only works for Customer administrators and for Partner administrators to query their own organization. Partner administrators looking to query customer organizations should use the List Locations endpoint to retrieve information about locations.

Parameters

location_id (str) – A unique identifier for the location.

Returns

location details

Return type

Location

create(name: str, time_zone: str, preferred_language: str, announcement_language: str, address1: str, city: str, state: str, postal_code: str, country: str, address2: Optional[str] = None, org_id: Optional[str] = None)[source]

Create a new Location for a given organization. Only an admin in a Webex Calling licensed organization can create a new Location.

The following body parameters are required to create a new location: name, timeZone, preferredLanguage, address, announcementLanguage.

Creating a location in your organization requires an administrator auth token with the spark-admin:locations_write.

Parameters
  • name (str) – The name of the location.

  • time_zone (str) – Time zone associated with this location

  • preferred_language (str) – Default email language.

  • announcement_language (str) – Location’s phone announcement language.

  • address1 (str) – Address 1

  • address2 (str) – Address 2

  • city (str) – City

  • state (str) – State Code

  • postal_code (str) – Postal Code

  • country (str) – ISO-3166 2-Letter Country Code.

  • org_id (str) – Create a location common attribute for this organization.

Returns

ID of new location

Return type

Location

update(location_id: str, settings: Location, org_id: Optional[str] = None)[source]

Update details for a location, by ID.

Specify the location ID in the locationId parameter in the URI. Only an admin can update a location details.

Updating a location in your organization requires an administrator auth token with the spark-admin:locations_write.

Example :

api.telephony.location.update(location_id=location_id,
                              settings=TelephonyLocation(
                                  calling_line_id=CallingLineId(
                                      phone_number=tn),
                                  routing_prefix=routing_prefix,
                                  outside_dial_digit='9'))
Parameters
  • location_id (str) – Update location common attributes for this location.

  • settings (Location) – new settings for the org:

  • org_id (str) – Update location common attributes for this organization

base = 'locations'
session: RestSession

REST session