Это перевод страницы документации с английского языка. Помогите нам сделать его лучше.

templatedashboard.create

Description

object templatedashboard.create(object/array templateDashboards)

This method allows to create new template dashboards.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) Template dashboards to create.

Additionally to the standard template dashboard properties, the method accepts the following parameters.

Parameter Type Description
pages
(required)
array Template dashboard pages to be created for the dashboard. Dashboard pages will be ordered in the same order as specified. At least one dashboard page object is required for pages property.

Возвращаемые значения

(объект) Возвращает объект, который содержит ID созданных шаблонов панелей, указанных в свойстве dashboardids. Порядок возвращаемых идентификаторов соответствует порядку переданных шаблонов панелей.

Примеры

Creating a template dashboard

Create a template dashboard named “Graphs” with one Graph widget on a single dashboard page.

Request:

{
           "jsonrpc": "2.0",
           "method": "templatedashboard.create",
           "params": {
               "templateid": "10318",
               "name": "Graphs",
               "pages": [
                   {
                       "widgets": [
                           {
                               "type": "graph",
                               "x": 0,
                               "y": 0,
                               "width": 12,
                               "height": 5,
                               "view_mode": 0,
                               "fields": [
                                   {
                                       "type": 6,
                                       "name": "graphid",
                                       "value": "1123"
                                   }
                               ]
                           }
                       ]
                       
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "dashboardids": [
                   "32"
               ]
           },
           "id": 1
       }

See also

Исходный код

CTemplateDashboard::create() в ui/include/classes/api/services/CTemplateDashboard.php.