URL : /subscribers
Method : post
Body
{
"fullname": "Jane Doe",
"identificationNumber": "54321"
}
Responses
- If a new user
{
Subscriber:54321 saved
}
2.. If user is already registered
{
Subscriber:5233 already registered.Cannot register again
}
URL : /categories
Method : get
Response
[
{
"id": 1,
"categoryName": "Comedy"
},
{
"id": 2,
"categoryName": "Animation"
},
{
"id": 3,
"categoryName": "Drama"
},
{
"id": 4,
"categoryName": "Action"
}
]
URL : /movies
Method : get
Response
[
{
"id": 5,
"name": "Lego",
"type": "original",
"yearOfRelease": "2018",
"contentowner": null,
"categories": [
{
"id": 2,
"categoryName": "Animation"
}
]
},
{
"id": 6,
"name": "Avengers Endgame",
"type": "original",
"yearOfRelease": "201",
"contentowner": null,
"categories": [
{
"id": 4,
"categoryName": "Action"
}
]
}
]
URL: /movies/{categoryId}
METHOD: GET
Request Parameter: type= <suggested/original>
http://localhost:9000/movies/2?type=original
Response
[
{
"id": 5,
"name": "Lego",
"type": "original",
"yearOfRelease": "2018",
"contentowner": null,
"categories": [
{
"id": 2,
"categoryName": "Animation"
}
]
},
{
"id": 6,
"name": "Avengers Endgame",
"type": "original",
"yearOfRelease": "201",
"contentowner": null,
"categories": [
{
"id": 4,
"categoryName": "Action"
}
]
}
]
URL: /movies
METHOD: POST
Request Header: "identificationNumber"
Body
{
"name": "Joker",
"yearOfRelease": "2020",
"categories": [
{
"categoryName": "comedy"
},
{
"categoryName": "action"
}
]
}
Response
{
"id": 13,
"name": "Joker",
"type": "suggested",
"yearOfRelease": "2020",
"contentowner": {
"id": 7,
"identificationNumber": "5233",
"fullname": "Idah Koome"
},
"categories": [
{
"id": 11,
"categoryName": "comedy"
},
{
"id": 12,
"categoryName": "action"
}
]
}
URL: /movies/{movieId}
METHOD: PATCH
Request Header: "identificationNumber"
Body