wxc_sdk.reports package

Reports API

class wxc_sdk.reports.ValidationRules(*, field: str | None = None, required: str | None = None, **extra_data: Any)[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, timezoneEnabled: bool | None = None, **extra_data: Any)[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

timezone_enabled: bool | None
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, timeZone: 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, **extra_data: Any)[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.

time_zone: str | None

Time zone used for report date and time values. Use an IANA time zone name. The default value is UTC when not specified.

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)[source]

Bases: ApiChild

Reports

To access these endpoints, 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 org needs to be licensed for the Pro Pack.

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.

For more information about Reports, see the Admin API guide.

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.

Validation Fields

Each template includes validation rules that specify which fields are required when generating a report using the Reports API. The possible validation field values are:

  • templateId: The unique identifier of the report template to use. This is always required when creating a report.

  • siteList: A comma-separated list of Webex sites (e.g., ‘cisco.webex.com’). Required for site-based templates, typically for Webex Meetings reports.

  • subIds: Subscription IDs for the report. Required for certain enterprise agreement templates, particularly for Webex Onboarding service reports.

  • startDate: The start date for the report data range in YYYY-MM-DD format. Required for date-range based templates.

  • endDate: The end date for the report data range in YYYY-MM-DD format. Required for date-range based templates.

When creating a report, ensure you provide all fields marked as ‘required’: ‘yes’ in the template’s validation rules.

Returns:

list of report templates

Return type:

list[ReportTemplate]

list(report_id: str = None, service: str = None, template_id: str = None, from_date: date = None, to_date: date = 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.

Reports are usually provided in zip format. A Content-header application/zip or application/octet-stream does indicate the zip format. There is usually no .zip file extension.

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: str | date | None = None, end_date: str | date | None = None, site_list: str = None, time_zone: str = None) → str[source]

Create a Report

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.

The ‘templateId’ parameter is a number. However, it is a limitation of developer.webex.com platform that it is passed as a string when you try to test the API from here.

CSV reports for Webex suite 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 (Union[str, datetime]) – Data in the report will be from this date onwards.

  • end_date (Union[str, datetime]) – 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.

  • time_zone (str) – Time zone used for report date and time values. Use an IANA time zone name. This field is optional.

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[str, Any], 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'
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, route_list_calls_overage: 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, pstnVendorName: str | None = None, pstnLegalEntity: str | None = None, pstnVendorOrgId: str | None = None, pstnProviderId: str | None = None, externalCustomerId: str | None = None, redirectingPartyUuid: str | None = None, publicCallingIpAddress: str | None = None, publicCalledIpAddress: str | None = None, callerIdNumber: str | None = None, externalCallerIdNumber: str | None = None, deviceOwnerUuid: str | None = None, callRecordingPlatformName: str | None = None, callRecordingResult: str | None = None, callRecordingTrigger: str | None = None, original_called_party_uuid: str | None = None, recall_type: str | None = None, hold_duration: int | None = None, auto_attendant_key_pressed: str | None = None, queue_type: str | None = None, answered_elsewhere: str | None = None, caller_reputation_score: str | None = None, caller_reputation_service_result: str | None = None, caller_reputation_score_reason: str | None = None, interaction_id: str | None = None, wxcc_consult_merge_status: str | None = None, ELIN: str | None = None, emergency_number_source: str | None = None, transfer_type: str | None = None, transfer_type_context: str | None = None, answer_reason: str | None = None, **extra_data: Any)[source]

Bases: CDR

Records in a Calling Detailed Call History report

classmethod from_dicts(dicts: Iterable[dict[str, Any]]) → 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)))