Playlist API

Search Playlist

GET /api/playlists

Get all existing playlist for the current organization using pagination

Example Request:

  1. GET /api/playlists HTTP/1.1
  2. Accept: application/json
  3. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Querystring Parameters:

These parameters are used as querystring parameters.

  • query - Limit response to playlist having a name like this value.
  • limit - Limit response to X number of playlist.Example Response:
  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. [
  4. {
  5. "id": 1,
  6. "name": "my playlist",
  7. "interval": "5m"
  8. }
  9. ]

Get one playlist

GET /api/playlists/:id

Example Request:

  1. GET /api/playlists/1 HTTP/1.1
  2. Accept: application/json
  3. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Example Response:

  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. {
  4. "id" : 1,
  5. "name": "my playlist",
  6. "interval": "5m",
  7. "orgId": "my org",
  8. "items": [
  9. {
  10. "id": 1,
  11. "playlistId": 1,
  12. "type": "dashboard_by_id",
  13. "value": "3",
  14. "order": 1,
  15. "title":"my third dasboard"
  16. },
  17. {
  18. "id": 2,
  19. "playlistId": 1,
  20. "type": "dashboard_by_tag",
  21. "value": "myTag",
  22. "order": 2,
  23. "title":"my other dasboard"
  24. }
  25. ]
  26. }

Get Playlist items

GET /api/playlists/:id/items

Example Request:

  1. GET /api/playlists/1/items HTTP/1.1
  2. Accept: application/json
  3. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Example Response:

  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. [
  4. {
  5. "id": 1,
  6. "playlistId": 1,
  7. "type": "dashboard_by_id",
  8. "value": "3",
  9. "order": 1,
  10. "title":"my third dasboard"
  11. },
  12. {
  13. "id": 2,
  14. "playlistId": 1,
  15. "type": "dashboard_by_tag",
  16. "value": "myTag",
  17. "order": 2,
  18. "title":"my other dasboard"
  19. }
  20. ]

Get Playlist dashboards

GET /api/playlists/:id/dashboards

Example Request:

  1. GET /api/playlists/1/dashboards HTTP/1.1
  2. Accept: application/json
  3. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Example Response:

  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. [
  4. {
  5. "id": 3,
  6. "title": "my third dasboard",
  7. "order": 1,
  8. },
  9. {
  10. "id": 5,
  11. "title":"my other dasboard"
  12. "order": 2,
  13. }
  14. ]

Create a playlist

POST /api/playlists/

Example Request:

  1. PUT /api/playlists/1 HTTP/1.1
  2. Accept: application/json
  3. Content-Type: application/json
  4. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
  5. {
  6. "name": "my playlist",
  7. "interval": "5m",
  8. "items": [
  9. {
  10. "type": "dashboard_by_id",
  11. "value": "3",
  12. "order": 1,
  13. "title":"my third dasboard"
  14. },
  15. {
  16. "type": "dashboard_by_tag",
  17. "value": "myTag",
  18. "order": 2,
  19. "title":"my other dasboard"
  20. }
  21. ]
  22. }

Example Response:

  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. {
  4. "id": 1,
  5. "name": "my playlist",
  6. "interval": "5m"
  7. }

Update a playlist

PUT /api/playlists/:id

Example Request:

  1. PUT /api/playlists/1 HTTP/1.1
  2. Accept: application/json
  3. Content-Type: application/json
  4. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
  5. {
  6. "name": "my playlist",
  7. "interval": "5m",
  8. "items": [
  9. {
  10. "playlistId": 1,
  11. "type": "dashboard_by_id",
  12. "value": "3",
  13. "order": 1,
  14. "title":"my third dasboard"
  15. },
  16. {
  17. "playlistId": 1,
  18. "type": "dashboard_by_tag",
  19. "value": "myTag",
  20. "order": 2,
  21. "title":"my other dasboard"
  22. }
  23. ]
  24. }

Example Response:

  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. {
  4. "id" : 1,
  5. "name": "my playlist",
  6. "interval": "5m",
  7. "orgId": "my org",
  8. "items": [
  9. {
  10. "id": 1,
  11. "playlistId": 1,
  12. "type": "dashboard_by_id",
  13. "value": "3",
  14. "order": 1,
  15. "title":"my third dasboard"
  16. },
  17. {
  18. "id": 2,
  19. "playlistId": 1,
  20. "type": "dashboard_by_tag",
  21. "value": "myTag",
  22. "order": 2,
  23. "title":"my other dasboard"
  24. }
  25. ]
  26. }

Delete a playlist

DELETE /api/playlists/:id

Example Request:

  1. DELETE /api/playlists/1 HTTP/1.1
  2. Accept: application/json
  3. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Example Response:

  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. {}