Dashboards

Create a Dashboard

Fields Required Description
title Yes The title of the new dashboard.
description No The description of the new dashboard.
items No The list of query items for the dashboard. Each item must be a valid cube query in the format described for the Advanced Reporting endpoint.
POST /api/v2/dashboards/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "title": "Sample Dashboard",
    "description": "",
    "items": [
        {
            "id": 1,
            "title": "Sample Query",
            "description": "",
            "chart": "table",
            "query": {
                "dimensions": [
                    "Application.name"
                ],
                "measures": [
                    "Project.count"
                ],
                "order": [
                    [
                        "Application.name",
                        "desc"
                    ]
                ],
                "filters": [
                    {
                        "or": [
                            {
                                "member": "Project.count",
                                "operator": "lt",
                                "values": [
                                    "5"
                                ]
                            }
                        ]
                    }
                ],
                "limit": 20
            }
        }
    ]
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": 6,
    "created": "2022-09-07T17:23:39.736328-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton",
        "is_active": true,
        "role": {
            "id": "UR4",
            "name": "Administrator"
        }
    },
    "modified_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton",
        "is_active": true,
        "role": {
            "id": "UR4",
            "name": "Administrator"
        }
    },
    "modified": "2022-09-07T17:23:39.736341-04:00",
    "title": "Sample Dashboard",
    "description": "",
    "items": [
        {
            "id": 1,
            "title": "Sample Query",
            "description": "",
            "chart": "table",
            "query": {
                "dimensions": [
                    "Application.name"
                ],
                "measures": [
                    "Project.count"
                ],
                "order": [
                    [
                        "Application.name",
                        "desc"
                    ]
                ],
                "filters": [
                    {
                        "or": [
                            {
                                "member": "Project.count",
                                "operator": "lt",
                                "values": [
                                    "5"
                                ]
                            }
                        ]
                    }
                ],
                "limit": 20
            }
        }
    ],
    "system": false,
    "default": false,
    "pinned": false
}

Get All Dashboards

This endpoint retrieves a list of dashboard resources.

GET /api/v2/dashboards/

Query Parameters

The following parameters may be used to filter the dashboard resources in the response.

Parameter Description
ordering Sort applications by specified field. Prefix with "minus" to sort descending. Sortable fields: title, description, id, created, created_by, modified, modified_by.

Expand Parameters

Parameter Description
created_by Expand the user field that created the dashboard.
GET /api/v2/dashboards/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [
        {
            "id": 1,
            "created": "2022-08-22T11:34:55.868251-04:00",
            "created_by": {
                "id": 1,
                "email": "admin@example.com",
                "first_name": "Admin",
                "last_name": "Testerton",
                "is_active": true,
                "role": {
                    "id": "UR4",
                    "name": "Administrator"
                }
            },
            "modified_by": {
                "id": 1,
                "email": "admin@example.com",
                "first_name": "Admin",
                "last_name": "Testerton",
                "is_active": true,
                "role": {
                    "id": "UR4",
                    "name": "Administrator"
                }
            },
            "modified": "2022-08-29T13:11:22.958631-04:00",
            "items": [
                "..."
            ],
            "title": "example",
            "description": "",
            "pinned": false,
            "default": false,
            "system": false
        }
    ]
}

Get a Specific Dashboard

This endpoint retrieves a specific Dashboard resource, as specified by the dashboard_id parameter.

GET /api/v2/dashboards/{dashboard_id}/

URL Parameters

Parameter Description
dashboard_id The id of the dashboard to retrieve.
GET /api/v2/dashboards/6/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 6,
    "title": "example",
    "description": "",
    "created": "2022-08-22T11:34:55.868251-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton",
        "is_active": true,
        "role": {
            "id": "UR4",
            "name": "Administrator"
        }
    },
    "modified_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton",
        "is_active": true,
        "role": {
            "id": "UR4",
            "name": "Administrator"
        }
    },
    "modified": "2022-08-29T13:11:22.958631-04:00",
    "items": [
        "..."
    ],
    "system": false,
    "pinned": false,
    "default": false
}

Update a Dashboard

Update a single dashboard by specifying new dashboard fields. The dashboard to update is identified by the dashboard_id.

PATCH /api/v2/dashboards/{dashboard_id}/

URL Parameters

Parameter Description
dashboard_id The id of the dashboard to edit must be submitted in the request.

Payload

Fields Required Description
title No The new title of the dashboard.
description No The new description of the dashboard.
items No The list of query items for the dashboard. Each item must be a valid cube query in the format described for the Advanced Reporting endpoint.
PATCH /api/v2/dashboards/8/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "title": "Sample Edit Dashboard",
    "description": "Sample Description",
    "items": [
        "..."
    ]
}
HTTP/1.1 200 OK
Content-Type: application/json

{
    "title": "Sample Edit Dashboard",
    "description": "Sample Description",
    "pinned": false,
    "default": false,
    "items": [
        "..."
    ],
    "created": "2022-07-14T14:14:11.811534-04:00",
    "modified": "2022-07-15T20:02:36.660029-04:00",
    "created_by": 1,
    "system": false
}

Delete a Dashboard

This endpoint deletes a single Dashboard resource, as specified by the dashboard_id parameter.

DELETE /dashboards/{dashboard_id}/

URL Parameters

Parameter Description
dashboard_id The id of the dashboard to delete.
DELETE /api/v2/dashboards/8/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 204 NO CONTENT

results matching ""

    No results matching ""