object report.create(объект/массив reports)
Этот метод позволяет создавать новые запланированные отчеты.
Этот метод доступен только пользователям с типом доступа Администратор и Супер-администратор. Разрешения на вызов метода можно отозвать в настройках ролей пользователя. Дополнительную информацию см. в разделе Роли пользователей.
(object/array) Scheduled reports to create.
Additionally to the standard scheduled report properties, the method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| users | object/array of objects | Users to send the report to. |
| user_groups | object/array of objects | User groups to send the report to. |
(object) Returns an object containing the IDs of the created scheduled reports under the reportids property. The order of the returned IDs matches the order of the passed scheduled reports.
Create a weekly report that will be prepared for the previous week every Monday-Friday at 12:00 from 2021-04-01 to 2021-08-31.
Request:
{ "jsonrpc": "2.0", "method": "report.create", "params": { "userid": "1", "name": "Weekly report", "dashboardid": "1", "period": "1", "cycle": "1", "start_time": "43200", "weekdays": "31", "active_since": "2021-04-01", "active_till": "2021-08-31", "subject": "Weekly report", "message": "Report accompanying text", "status": "1", "description": "Report description", "users": [ { "userid": "1", "access_userid": "1", "exclude": "0" }, { "userid": "2", "access_userid": "0", "exclude": "1" } ], "user_groups": [ { "usrgrpid": "7", "access_userid": "0" } ] }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 }Response:
CReport::create() в ui/include/classes/api/services/CReport.php.