{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
{
"email":"admin@gmail.com",
"password":"admin",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
Response
{
"status": 400,
"result": {
"title": [
"movies with this title already exists."
]
},
"record": {
"title": "Justice League",
"id": 25
}
}
Case 4 : Invalid credentials
Request
{
"email":"zzzzdmin@gmail.com",
"password":"admin",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
{
"email":"jhon@gmail.com",
"password":"jhon",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
Response
{
"status": 403,
"result": "Not Authorized to perform this operation",
}
Case 7 : Invalid input data
Request
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"title":"Justice League 2",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":14.3,
"year":20127
}
}
Response
{
"status": 400,
"result": {
"rating": [
"Ensure this value is less than or equal to 5.0."
],
"year": [
"Ensure this value is less than or equal to 2019."
]
}
}
{
"status": 400,
"result": "Invalid Data",
"record": [
{
"rating": 13.6,
"message": "Rating value should be between 0 - 5"
},
{
"year": 20122,
"message": "Year value should be between 1980 - current year"
}
]
}
Fetch Movies
Method
Endpoint
Access
GET
/movie
Admin/RegisterdUser
Case 1 : Valid input with token
Request - Parameters
token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Imtitle = man
Response
{
"status": 200,
"result": "Success fetching movie details",
"record": [
{
"title": "Spider-Man",
"description": "Spider-Man is a super hero movie",
"rating": 4.1,
"year": 2012
},
{
"title": "Batman Begins",
"description": "After witnessing his parents' death, Bruce learns the art of fighting to confront injustice. When he returns to Gotham as Batman, he must stop a secret society that intends to destroy the city.",
"rating": 4.4,
"year": 2005
},
{
"title": "Man of Steel",
"description": "After Superman discovers that he has extraordinary powers, he decides to use them for doing good. He even fights against members of his own race to defend the people of Earth.",
"rating": 4.2,
"year": 2013
},
{
"title": "Batman v Superman: Dawn of Justice",
"description": "Bruce Wayne, a billionaire, believes that Superman is a threat to humanity after his battle in Metropolis. Thus, he decides to adopt his mantle of Batman and defeat him once and for all.",
"rating": 4.6,
"year": 2016
}
]
}
{
"status": 400,
"result": "Invalid Data",
"record": [
{
"rating": 13.6,
"message": "Rating value should be between 0 - 5"
},
{
"year": 20122,
"message": "Year value should be between 1980 - current year"
}
]
}