-
Notifications
You must be signed in to change notification settings - Fork 0
Movie Lists
dionisggr edited this page Feb 21, 2021
·
4 revisions
URL: /api/lists
Method: GET
Auth required: Yes
Bearer my-secret-key
Bearer my-secret-admin
Bearer <JSON Web Token>
Code: 200 OK
Content example
[
{
"list_id": "1",
"name": "Admin list",
"user_id": 1,
"movies": [...]
},
{
"list_id": "2",
"name": "Top Rated",
"user_id": null,
"movies": [...]
}
...
]
URL: /api/lists/main
Method: GET
Auth required: Yes
Bearer my-secret-key
Bearer my-secret-admin
Bearer <JSON Web Token>
Code: 200 OK
Content example
[
{
"list_id": "2",
"name": "Top Rated",
"user_id": null,
"movies": [...]
},
{
"list_id": "3",
"name": "Popular",
"user_id": null,
"movies": [...]
}
...
]
URL: /api/lists
Method: POST
Auth required: Yes
Bearer my-secret-key
Bearer my-secret-admin
Bearer <JSON Web Token>
Requires headers: {'Content-Type': 'application/json'}
{
"name": "New List Name",
"user_id": 1 // Optional
}
Name | Type | In | Description |
---|---|---|---|
name |
string | header | Name of list |
user_id |
integer | header | Description of list |
Code: 201 Created
Content example
{
"list_id": 3,
"name": "New List Name",
"user_id": 1
}
URL: /api/lists/:list
Method: PATCH
Auth required: Yes
Bearer my-secret-key
Bearer my-secret-admin
Bearer <JSON Web Token>
Requires headers: {'Content-Type': 'application/json'}
{
"name": "New Name"
}
Name | Type | In | Description |
---|---|---|---|
list |
integer | path | List ID |
name |
string | header | Name of list |
Code: 201 Created
(Resource updated successfully, and refreshes.)
Content example
{
"list_id": 3,
"name": "New Name",
"user_id": 2
}
All values will be necessary in Update due to previous empty field validation
URL: /api/lists/:list
Method: DELETE
Auth required: Yes
Bearer my-secret-key
Bearer my-secret-admin
Bearer <JSON Web Token>
Name | Type | In | Description |
---|---|---|---|
list |
integer | path | LIst ID |
Code: 301 Moved Permanently
Content example
<No Content>