-
Notifications
You must be signed in to change notification settings - Fork 1
Resources REST API Documentation
Following resources are available through REST API. Given alongside is the respective endpoint.
- App -
apps
- Category -
categories
- Module -
modules
- Playlist -
playlists
- Content -
contents
- PlaylistContent -
playlist_contents
- Device -
devices
- Location -
locations
- Activity -
activities
All endpoints follow the standard REST conventions.
The end user only has permission to read resources, except in case of Activity.
Returns json data about a all resource.
-
URL
/{{endpoint}}
-
Method:
GET
-
Query Params
offset=[integer]
limit=[integer]
sortField=[string]
sortDir=[ASC or DESC]
- Must be specified if sortField is providedfilters=[object]
-
Success Response:
-
Code: 200
Content:[{ id : 12, name : "Michael Bloom" }, {id: 13, name : "Vaibhav Sinha"}]
-
Code: 200
-
Error Response:
-
Code: 401 UNAUTHORIZED
Content:{ error : "You are unauthorized to make this request." }
-
Code: 401 UNAUTHORIZED
Returns json data about a single resource.
-
URL
/{{endpoint}}/:id
-
Method:
GET
-
URL Params
Required:
id=[integer]
-
Data Params
None
-
Success Response:
-
Code: 200
Content:{ id : 12, name : "Michael Bloom" }
-
Code: 200
-
Error Response:
-
Code: 404 NOT FOUND
Content:{ error : "Resource doesn't exist" }
OR
-
Code: 401 UNAUTHORIZED
Content:{ error : "You are unauthorized to make this request." }
-
Code: 404 NOT FOUND
Creates a new resource.
-
URL
/{{endpoint}}
-
Method:
POST
-
Data Params
The resource object
-
Success Response:
-
Code: 200
Content:{ id : 12, name : "Michael Bloom" }
-
Code: 200
-
Error Response:
-
Code: 400 BAD REQUEST
Content:{ error : "Name must be unique" }
OR
-
Code: 401 UNAUTHORIZED
Content:{ error : "You are unauthorized to make this request." }
-
Code: 400 BAD REQUEST
Updates an existing resource.
-
URL
/{{endpoint}}/:id
-
Method:
PUT
-
URL Params
Required:
id=[integer]
-
Data Params
The resource object
-
Success Response:
-
Code: 200
Content:{ id : 12, name : "Michael Bloom" }
-
Code: 200
-
Error Response:
-
Code: 404 NOT FOUND
Content:{ error : "Resource not found" }
OR
-
Code: 401 UNAUTHORIZED
Content:{ error : "You are unauthorized to make this request." }
-
Code: 404 NOT FOUND
Deletes an existing resource.
-
URL
/{{endpoint}}/:id
-
Method:
DELETE
-
URL Params
Required:
id=[integer]
-
Success Response:
-
Code: 200
Content:{ id : 12, name : "Michael Bloom", status: "deleted" }
-
Code: 200
-
Error Response:
-
Code: 404 NOT FOUND
Content:{ error : "Resource not found" }
OR
-
Code: 401 UNAUTHORIZED
Content:{ error : "You are unauthorized to make this request." }
-
Code: 404 NOT FOUND