switchvox.scheduledReports.callReports.update
From SwitchvoxExtendAPI
Contents |
Description
This method allows you to define the parameters to update a Scheduled Call Report that you want run in the system and attach it to a previously created schedule (see switchvox.schedule.add). Every time date/time this schedule fires it will email the report to the delivery_email parameter. For more information about Scheduled Reports see our Switchvox Administration Manual. Only the parameters that you pass in will update on the scheduled report and any parameters that you omit will stay the same.
Arguments
- See the Constructing Requests page to learn how to use arguments in requests.
| Name | Required | Type | Default | Description |
| scheduled_report_id | required | integer | ID of the scheduled report you want to use. | |
| schedule_id | optional | integer | ID of the schedule you want to use. | |
| scheduled_report_name | optional | string | Name of your scheduled report. Example: "Sales Outgoing Full Day" | |
| scheduled_report_type | optional | string | Type of the report you want. Possible values:call_report | |
| scheduled_report_format | optional | string | The delivery format of the report. Possible values:xml,chart, or html. | |
| start_from_beginning | optional | string | Defines that the start time of each scheduled report should be the beginning of the same day, week, month or year that the report runs. Only one of the following parameters may be submitted, and at least one of them is required: start_from_beginning, start_from_decrement or start_from_date. |
|
| start_from_decrement | optional | string | Defines that the start time of the each scheduled report should be calculated from the current run time of the report minus a defined decrement. Format: 1Y,2M,3W,4D,2h,3m = 1 year, 2 months, 3 weeks, 4 days, 2 hours, 3 minutes. Example: To create a sliding window and get the past 4 hours of call reports you would use: 4h.
Only one of the following parameters may be submitted, and at least one of them is required: start_from_beginning, start_from_decrement or start_from_date. |
|
| start_from_date | optional | datetime | Defines that the start date / time of each scheduled report should be from a defined date. Only one of the following parameters may be submitted, and at least one of them is required: start_from_beginning, start_from_decrement or start_from_date. |
|
| delivery_email | optional | Email address where the reports should be sent. | ||
| account_ids account_id |
optional | integer | A list of account ids. To get a list of account_ids on your system or convert extensions to account_ids see switchvox.extensions.search. | |
| iax_provider_ids iax_provider_id |
optional | integer | A list of IAX provider IDs. | |
| sip_provider_ids sip_provider_id |
optional | integer | A list of SIP provider IDs. | |
| channel_group_ids channel_group_id |
optional | integer | A list of channel group IDs. | |
| incoming_did | optional | integer | Search based on incoming DID. | |
| breakdown | optional | string | cumulative | The report breakdown. Possible values: cumulative, by_day, by_account, by_hour_of_day, and by_day_of_week. |
| report_fields report_field |
optional | string | total_calls | A list of the fields to report. Possible values: total_calls, total_incoming_calls, total_outgoing_calls, talking_duration, call_duration, avg_talking_duration, and avg_call_duration. |
| ignore_weekends | optional | boolean | 0 | Flag to ignore weekends or not. Set to 1 to ignore weekends or 0 to include weekends in your report. |
| format | optional | string | xml | Format of the report. Possible values: xml, excel and chart. |
| sort_field | optional | string | sort_name | The field on which to sort the returned report. Possible values: sort_name, date, hour, day_of_week, account, extension, total_calls, total_incoming_calls, total_outgoing_calls, talking_duration, call_duration, avg_talking_duration and avg_call_duration. Value ignored for cumulative searches. |
| sort_order | optional | string | ASC | The order in which to sort returned call log entries. Possible values: ASC and DESC. |
| items_per_page | optional | integer | 50 | Number of records to return per page. |
| page_number | optional | integer | 1 | The page number of the results to return |
Example Requests & Responses
- Please see the API Request and Response Format section for more information on various request encodings.
Example One
Updates scheduled report #24 and just changes the format to be a chart.
Request
<request method="switchvox.scheduledReports.callReports.update"> <parameters> <scheduled_report_id>24</scheduled_report_id> <scheduled_report_format>chart</scheduled_report_format> </parameters> </request>
Response
<response method="switchvox.scheduledReports.callReports.update"> <result> <success /> </result> </response>
Error Codes
- See the Error Code Formatting section to see the xml structure when an error is returned.
- See the Generic Error Codes section to see a list of general fault codes that may be returned.
| Code | Description |
| 57139 | Requested scheduled report id does not exist in the system. |
See switchvox.scheduledReports.add for other potential Faults that could be triggered by this method.