wxc_sdk.reports package

Reports API

class wxc_sdk.reports.ValidationRules(*, field: str | None = None, required: str | None = None)[source]

Bases: ApiModel

field: str | None

Field on which validation rule is applied

required: str | None

Whether the above field is required

class wxc_sdk.reports.ReportTemplate(*, Id: int | None = None, title: str | None = None, service: str | None = None, maxDays: int | None = None, startDate: date | None = None, endDate: date | None = None, identifier: str | None = None, validations: list[ValidationRules] | None = None)[source]

Bases: ApiModel

id: int | None

Unique identifier representing a report.

title: str | None

Name of the template.

service: str | None

The service to which the report belongs.

max_days: int | None

Maximum date range for reports belonging to this template.

start_date: date | None
end_date: date | None
identifier: str | None

Generated reports belong to which field.

validations: list[ValidationRules] | None

an array of validation rules

class wxc_sdk.reports.Report(*, Id: str | None = None, title: str | None = None, service: str | None = None, startDate: date | None = None, endDate: date | None = None, siteList: str | None = None, created: datetime | None = None, createdBy: str | None = None, scheduleFrom: str | None = None, status: str | None = None, downloadDomain: str | None = None, downloadURL: str | None = None)[source]

Bases: ApiModel

id: str | None

Unique identifier for the report.

title: str | None

Name of the template to which this report belongs.

service: str | None

The service to which the report belongs.

start_date: date | None

The data in this report belongs to dates greater than or equal to this.

end_date: date | None

The data in this report belongs to dates smaller than or equal to this.

site_list: str | None

The site to which this report belongs to. This only exists if the report belongs to service Webex.

created: datetime | None

Time of creation for this report.

created_by: str | None

The person who created the report.

schedule_from: str | None

Whether this report was scheduled from API or Control Hub.

status: str | None

Completion status of this report.

download_domain: str | None
download_url: str | None

The link from which the report can be downloaded.

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

Bases: ApiChild

Report templates are available for use with the Reports API.

To access this endpoint, you must use an administrator token with the analytics:read_all scope. The authenticated user must be a read-only or full administrator of the organization to which the report belongs.

To use this endpoint the organization needs to be licensed for Pro Pack for Control Hub.

Reports available via Webex Control Hub may be generated and downloaded via the Reports API. To access this API, the authenticated user must be a read-only or full administrator of the organization to which the report belongs.

list_templates() list[ReportTemplate][source]

List all the available report templates that can be generated.

CSV (comma separated value) reports for Webex services are only supported for organizations based in the North American region. Organizations based in other regions will return blank CSV files for any Webex reports.

Returns:

list of report templates

Return type:

list[ReportTemplate]

list(report_id: str | None = None, service: str | None = None, template_id: str | None = None, from_date: date | None = None, to_date: date | None = None) Generator[Report, None, None][source]

Lists all reports. Use query parameters to filter the response. The parameters are optional. However, from and to parameters should be provided together.

CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.

Parameters:
  • report_id – List reports by ID.

  • service – List reports which use this service.

  • template_id – List reports with this report template ID.

  • from_date – List reports that were created on or after this date.

  • to_date – List reports that were created before this date.

Returns:

yields Report instances

create(template_id: int, start_date: date | None = None, end_date: date | None = None, site_list: str | None = None) str[source]

Create a new report. For each templateId, there are a set of validation rules that need to be followed. For example, for templates belonging to Webex, the user needs to provide siteUrl. These validation rules can be retrieved via the Report Templates API.

CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.

Parameters:
  • template_id (int) – Unique ID representing valid report templates.

  • start_date (date) – Data in the report will be from this date onwards.

  • end_date (date) – Data in the report will be until this date.

  • site_list (str) – Sites belonging to user’s organization. This attribute is needed for site-based templates.

Returns:

The unique identifier for the report.

Return type:

str

details(report_id: str) Report[source]

Shows details for a report, by report ID.

Specify the report ID in the reportId parameter in the URI.

CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.

Parameters:

report_id (str) – The unique identifier for the report.

Returns:

report details

Return type:

Report

delete(report_id: str)[source]

Remove a report from the system.

Specify the report ID in the reportId parameter in the URI

CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.

Parameters:

report_id (str) – The unique identifier for the report.

download(url: str) Generator[dict, None, None][source]

Download a report from the given URL and yield the rows as dicts

Parameters:

url (str) – download URL

Returns:

yields dicts

base = 'devices'
session: RestSession

REST session

class wxc_sdk.reports.CallingCDR(*, startTime: datetime | None = None, answerTime: datetime | None = None, duration: int | None = None, answered: bool | None = None, direction: CDRDirection | str | None = None, calledLineId: str | None = None, callId: str | None = None, callingLineId: str | None = None, callType: CDRCallType | None = None, clientType: CDRClientType | None = None, clientVersion: str | None = None, correlationId: str | None = None, internationalCountry: str | None = None, local_sessionid: str | None = None, deviceMac: str | None = None, inboundTrunk: str | None = None, orgUuid: str | None = None, originalReason: CDROriginalReason | None = None, osType: str | None = None, outboundTrunk: str | None = None, redirectReason: CDRRedirectReason | None = None, relatedReason: CDRRelatedReason | None = None, reportId: str | None = None, reportTime: datetime | None = None, routeGroup: str | None = None, siteMainNumber: str | None = None, siteTimezone: str | None = None, subClientType: str | None = None, userUuid: str | None = None, user: str | None = None, userType: CDRUserType | None = None, calledNumber: str | None = None, callingNumber: str | None = None, location: str | None = None, dialedDigits: str | None = None, releasingParty: str | None = None, remote_sessionid: str | None = None, redirectingNumber: str | None = None, siteUuid: str | None = None, departmentId: str | None = None, transferRelatedCallId: str | None = None, authorizationCode: str | None = None, model: str | None = None, callTransferTime: datetime | None = None, localCallId: str | None = None, remoteCallId: str | None = None, networkCallId: str | None = None, relatedCallId: str | None = None, userNumber: str | None = None, callOutcome: str | None = None, callOutcomeReason: str | None = None, ringDuration: int | None = None, answerIndicator: str | None = None, releaseTime: datetime | None = None, final_local_sessionid: str | None = None, final_remote_sessionid: str | None = None)[source]

Bases: CDR

Records in a Calling Detailed Call History report

classmethod from_dicts(dicts: Iterable[dict]) Generator[CallingCDR, None, None][source]

Yield CallingCDR instances from dicts

Parameters:

dicts – iterable with the dicts to yield CDRs from

Returns:

yields CallingCDR instances

Example

# download call history report from Webex
cdrs = list(CallingCDR.from_dicts(api.reports.download(url=url)))
start_time: datetime | None

This is the start time of the call, the answer time may be slightly after this. Time is in UTC.

answer_time: datetime | None

The time the call was answered. Time is in UTC.

duration: int | None

The length of the call in seconds.

answered: bool | None
direction: CDRDirection | str | None

Whether the call was inbound or outbound. The possible values are:

called_line_id: str | None

For incoming calls, the calling line ID of the user. For outgoing calls, it’s the calling line ID of the called party.

call_id: str | None
calling_line_id: str | None
call_type: CDRCallType | None

Type of call. For example:

client_type: CDRClientType | None

The type of client that the user (creating this record) is using to make or receive the call. For example:

client_version: str | None

The version of the client that the user (creating this record) is using to make or receive the call.

correlation_id: str | None

Correlation ID to tie together multiple call legs of the same call session.

international_country: str | None

The country code of the dialed number. This is only populated for international calls.

local_session_id: str | None

Each call consists of four UUIDs known as Local Session ID, Final Local Session ID, Remote Session ID and Final Remote Session ID.

  • The Session ID comprises a Universally Unique Identifier (UUID) for each user-agent participating in a call.

  • It can be used for end-to-end tracking of a SIP session in IP-based multimedia communication systems in compliance with RFC 7206 and draft-ietf-insipid-session-id-15.

  • The Local SessionID is generated from the Originating user agent.

  • The Remote SessionID is generated from the Terminating user agent.

  • The Final Local Session ID has the value of the Local Session ID at the end of the call.

  • The Final Remote Session ID has the value of the Remote Session ID at the end of the call.

device_mac: str | None

The MAC address of the device, if known.

inbound_trunk: str | None

Inbound trunk may be presented in Originating and Terminating records.

org_uuid: str | None

A unique identifier for the organization that made the call. This is a unique identifier across Cisco.

original_reason: CDROriginalReason | None

Populated for calls that transfer, hold, wait, and so on. For example:

os_type: str | None

The operating system that the app was running on, if available.

outbound_trunk: str | None

Outbound trunk may be presented in Originating and Terminating records.

redirect_reason: CDRRedirectReason | None

Populated for calls that transfer, hold, wait, and so on. For example:

related_reason: CDRRelatedReason | None

Populated for calls that transfer, hold, wait, and so on. For example:

report_id: str | None

A unique ID for this particular record. This can be used when processing records to aid in deduplication.

report_time: datetime | None

The time this report was created. Time is in UTC.

route_group: str | None

If present, this field’s only reported in Originating records. Route group identifies the route group used for outbound calls routed via a route group to Premises-based PSTN or an on-prem deployment integrated with Webex Calling (dial plan or unknown extension).

site_main_number: str | None

The main number for the user’s site where the call was made or received.

site_timezone: str | None

Site timezone is the offset in minutes from UTC time of the user’s timezone.

sub_client_type: str | None

If the call is TO or FROM a mobile phone using Webex Go, the Client type will show SIP, and Sub client type will show MOBILE_NETWORK.

user_uuid: str | None

A unique identifier for the user associated with the call. This is a unique identifier across Cisco products.

user: str | None

The user who made or received the call.

user_type: CDRUserType | None

The type of user (user or workspace) that made or received the call. For example:

  • AutomatedAttendantVideo

  • Anchor

  • BroadworksAnywhere

  • VoiceMailRetrieval

  • LocalGateway

  • HuntGroup

  • GroupPaging

  • User

  • VoiceMailGroup

  • CallCenterStandard

  • VoiceXML

  • RoutePoint

called_number: str | None

For incoming calls, the telephone number of the user. For outgoing calls, it’s the telephone number of the called party.

calling_number: str | None

For incoming calls, the telephone number of the calling party. For outgoing calls, it’s the telephone number of the user.

location: str | None

Location of the report.

dialed_digits: str | None

Feature access codes (FAC) used for invoking features such as Last Number Redial or a Call Return.

An extension that got dialed and a mis-dialed keypad digit from a device/app.

When a user must dial an outside access code (for example, 9+) before dialing a number, this access code is also reported, as well as the digits dialed thereafter. Note that when pre-translations have no effect, the dialed digits field contains the same data as the called number field. This field is only used for originating (outgoing) Calls and is not available for terminating (incoming) Calls.

releasing_party: str | None

Indicates which party released the call first. The possible values are:

Local: Used when the local user has released the call first.

Remote: Used when the far end party releases the call first.

Unknown: Used when the call has partial information or is unable to gather enough information about the party who released the call. It could be because of situations like force lock or because of a session audit failure.

remote_session_id: str | None

Each call consists of four UUIDs known as Local Session ID, Final Local Session ID, Remote Session ID and Final Remote Session ID.

  • The Session ID comprises a Universally Unique Identifier (UUID) for each user-agent participating in a call.

  • It can be used for end-to-end tracking of a SIP session in IP-based multimedia communication systems in compliance with RFC 7206 and draft-ietf-insipid-session-id-15.

  • The Local SessionID is generated from the Originating user agent.

  • The Remote SessionID is generated from the Terminating user agent.

  • The Final Local Session ID has the value of the Local Session ID at the end of the call.

  • The Final Remote Session ID has the value of the Remote Session ID at the end of the call.

redirecting_number: str | None

When the call has been redirected one or more times, this field reports the last redirecting number. Identifies who last redirected the call. Only applies to call scenarios such as transfer, call forwarded calls, simultaneous rings, etc.

site_uuid: str | None

A unique identifier for the site associated with the call. Unique across Cisco products.

department_id: str | None

A unique identifier for the user’s department name.

Transfer related call ID is used as a call identifier of the other call involved in the transfer. You can share this ID with Cisco TAC to help them pinpoint parties who are involved during a call transfer.

authorization_code: str | None

The authorization code admin created for a location or site for users to use. Collected by the Account/Authorization Codes or Enhanced Outgoing Calling Plan services.

model: str | None

The device model type the user is using to make or receive the call.

call_transfer_time: datetime | None

Indicates the time at which the call transfer service was invoked during the call. The invocation time is shown using the UTC/GMT time zone.

local_call_id: str | None

A unique identifier that’s used to correlate CDRs and call legs with each other. This ID is used in conjunction with:

Remote call ID—To identify the remote CDR of a call leg.

Transfer related call ID—To identify the call transferred leg.

remote_call_id: str | None

A unique identifier that’s used to correlate CDRs and call legs with each other. This ID is used in conjunction with Local call ID to identity the local CDR of a call leg.

network_call_id: str | None

A unique identifier that shows if other CDRs are in the same call leg. Two CDRs belong in the same call leg if they have the same Network call ID.

related_call_id: str | None

Call identifier of a different call that was created by this call because of a service activation. The value is the same as the Local call ID field of the related call. You can use this field to correlate multiple call legs connected through other services.

user_number: str | None

Represents the E.164 number of the user generating a CDR. If the user has no number assigned to them, then their extension will be displayed instead.

call_outcome: str | None

Identifies whether the call was set up or disconnected normally. Possible values are:

Success—Call was routed and disconnected successfully. Includes Normal, UserBusy, and NoAnswer scenarios.

Failure—Call failed with an internal or external error.

Refusal—Call was rejected because of call block or timeout.

You can find more information in the Call outcome reason field.

call_outcome_reason: str | None

Additional information about the Call outcome returned. Possible reasons are:

Success

  • Normal—Call was completed successfully.

  • UserBusy—Call was a success, but the user was busy.

  • NoAnswer—Call was a success, but the user didn’t answer.

Refusal

  • CallRejected—User rejected the call.

  • UnassignedNumber—Dialed number isn’t assigned to any user or service.

  • SIP408—Request timed out.

  • InternalRequestTimeout—Request timed out.

  • Q850102ServerTimeout—Server timed out.

  • NoUserResponse—No response from the user.

  • NoAnswerFromUser—No answer from the user.

  • SIP480—Caller was unavailable.

  • SIP487—Request was terminated by the called number.

  • TemporarilyUnavailable—User was temporarily unavailable.

  • AdminCallBlock—Call was rejected.

  • UserCallBlock—Call was rejected.

  • Unreachable—Unable to route the call to the destination.

Failure

  • DestinationOutOfOrder—Service request failed.

  • SIP501—Invalid method.

  • SIP503—Service was temporarily unavailable.

  • ProtocolError—Unknown release code.

  • SIP606—Some aspect of the session description wasn’t acceptable.

  • NoRouteToDestination—No route available to the destination.

  • Internal—Failed because of internal Webex Calling reasons.

ring_duration: int | None

The length of ringing before the call was answered or timed out, in seconds.

answer_indicator: str | None

Whether the call leg was answered after a redirection. Possible values: * Yes * No * Yes-PostRedirection

release_time: datetime | None

The time the call was finished, in UTC.

final_local_session_id: str | None

Each call consists of four UUIDs known as Local Session ID, Final Local Session ID, Remote Session ID and Final Remote Session ID.

  • The Session ID comprises a Universally Unique Identifier (UUID) for each user-agent participating in a call.

  • It can be used for end-to-end tracking of a SIP session in IP-based multimedia communication systems in compliance with RFC 7206 and draft-ietf-insipid-session-id-15.

  • The Local SessionID is generated from the Originating user agent.

  • The Remote SessionID is generated from the Terminating user agent.

  • The Final Local Session ID has the value of the Local Session ID at the end of the call.

  • The Final Remote Session ID has the value of the Remote Session ID at the end of the call.

final_remote_session_id: str | None

Each call consists of four UUIDs known as Local Session ID, Final Local Session ID, Remote Session ID and Final Remote Session ID.

  • The Session ID comprises a Universally Unique Identifier (UUID) for each user-agent participating in a call.

  • It can be used for end-to-end tracking of a SIP session in IP-based multimedia communication systems in compliance with RFC 7206 and draft-ietf-insipid-session-id-15.

  • The Local SessionID is generated from the Originating user agent.

  • The Remote SessionID is generated from the Terminating user agent.

  • The Final Local Session ID has the value of the Local Session ID at the end of the call.

  • The Final Remote Session ID has the value of the Remote Session ID at the end of the call.