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
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.
- 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.
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: 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:
- 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'
- 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)))