Snapshot API

    Example Request:

    JSON Body schema:

    • dashboard – Required. The complete dashboard model.
    • name – Optional. snapshot name
    • expires - Optional. When the snapshot should expire in seconds. 3600 is 1 hour, 86400 is 1 day. Default is never to expire.
    • external - Optional. Save the snapshot on an external server rather than locally. Default is false.
    • key - Optional. Define the unique key. Required if external is true.
    • deleteKey - Optional. Unique key used to delete the snapshot. It is different from the key so that only the creator can delete the snapshot. Required if external is true.

    Example Response:

    1. HTTP/1.1 200
    2. Content-Type: application/json
    3. {
    4. "deleteKey":"XXXXXXX",
    5. "deleteUrl":"myurl/api/snapshots-delete/XXXXXXX",
    6. "key":"YYYYYYY",
    7. "url":"myurl/dashboard/snapshot/YYYYYYY",
    8. "id": 1,
    9. }

    Keys:

    • deleteKey – Key generated to delete the snapshot
    • key – Key generated to share the dashboard

    Query parameters:

    • query – Search Query
    • limit – Limit the number of returned results

    Example Request:

    1. GET /api/dashboard/snapshots HTTP/1.1
    2. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

    Example Response:

    GET /api/snapshots/:key

    Example Request:

    1. GET /api/snapshots/YYYYYYY HTTP/1.1
    2. Accept: application/json
    3. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
    1. HTTP/1.1 200
    2. Content-Type: application/json
    3. {
    4. "meta":{
    5. "isSnapshot":true,
    6. "type":"snapshot",
    7. "canSave":false,
    8. "canEdit":false,
    9. "canStar":false,
    10. "slug":"",
    11. "expires":"2200-13-32T25:23:23+02:00",
    12. "created":"2200-13-32T28:24:23+02:00"
    13. },
    14. "dashboard": {
    15. "editable":false,
    16. "hideControls":true,
    17. "nav": [
    18. {
    19. "enable":false,
    20. "type":"timepicker"
    21. ],
    22. "rows": [
    23. {
    24. }
    25. ],
    26. "style":"dark",
    27. "tags":[],
    28. "templating":{
    29. "list":[
    30. ]
    31. },
    32. "time":{
    33. },
    34. "timezone":"browser",
    35. "title":"Home",
    36. "version":5
    37. }
    38. }

    DELETE /api/snapshots/:key

    Example Request:

    Example Response:

    1. HTTP/1.1 200
    2. Content-Type: application/json
    3. {"message":"Snapshot deleted. It might take an hour before it's cleared from any CDN caches.", "id": 1}

    This API call can be used without authentication by using the secret delete key for the snapshot.

    GET /api/snapshots-delete/:deleteKey

    1. GET /api/snapshots-delete/XXXXXXX HTTP/1.1

    Example Response: