RESTful web service to obtain movie information created using Django Restframework
Postman Documentaion : link
Module | Method | Desciption | Endpoint | Usage | Access |
---|---|---|---|---|---|
User Management | POST |
Adds new user | http://34.93.43.145:8000/user | Details | Admin |
User Management | DELETE |
Deletes specified user | http://34.93.43.145:8000/user | Details | Admin |
Movie | POST |
Adds new movie | http://34.93.43.145:8000/movie | Details | Admin |
Movie | DELETE |
Deletes specified movie | http://34.93.43.145:8000/movie | Details | Admin |
Movie | PUT |
Updates specified movie | http://34.93.43.145:8000/movie | Details | Admin |
Movie | GET |
Fetches movie details matching specified keyword | http://34.93.43.145:8000/movie | Details | Admin/Registered User |
Method | Endpoint | Access |
---|---|---|
POST |
/movie |
Admin |
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
{
"status": 200,
"result": "Added new record",
"record": {
"title": "Justice League",
"id": 25
}
}
{
"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
}
}
{
"status": 200,
"result": "Added new record",
"record": {
"title": "Justice League",
"id": 25
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im"
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
{
"status": 400,
"result": {
"title": [
"movies with this title already exists."
]
},
"record": {
"title": "Justice League",
"id": 25
}
}
{
"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
}
}
{
"status": 401,
"result": "Invalid Credentials"
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"title":"Justice League",
"description":"Steppenwolf and his Parademons set out to take over the Earth.",
"rating":4.3,
"year":2017
}
}
{
"status": 401,
"result": "Invalid Token, please login"
}
{
"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
}
}
{
"status": 403,
"result": "Not Authorized to perform this operation",
}
{
"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
}
}
{
"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."
]
}
}
Method | Endpoint | Access |
---|---|---|
DELETE |
/movie |
Admin |
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"id": 39
}
}
{
"status": 200,
"result": "Deleted record",
"record": {
"title": "test",
"id": 39
},
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"id": 39
}
}
{
"status": 200,
"result": "Specified record does not exists",
}
Method | Endpoint | Access |
---|---|---|
PUT |
/movie |
Admin |
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"id":40,
"description":"New Description",
"rating": 3.6
}
}
{
"status": 200,
"result": "Updated record",
"record": {
"id": 40,
"description": "New Description",
"rating": 3.6
}
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"id":400,
"description":"New Description",
"rating": 3.6,
}
}
{
"status": 200,
"result": "Specified record does not exists",
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"id":40,
"description":"New Description",
"rating": 13.6,
"year": 20122
}
}
{
"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"
}
]
}
Method | Endpoint | Access |
---|---|---|
GET |
/movie |
Admin/RegisterdUser |
token
= eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im
title
= man
{
"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
}
]
}
token
= eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im
title
= xyz
{
"status": 200,
"result": "Empty result-set"
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Im",
"data": {
"id":40,
"description":"New Description",
"rating": 13.6,
"year": 20122
}
}
{
"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"
}
]
}
Method | Endpoint | Access |
---|---|---|
POST |
/user |
Admin |
{
"email":"admin@gmail.com",
"password":"admin",
"data": {
"email":"jhon@gmail.com",
"password":"jhon",
"is_admin":false
}
}
{
"status": 200,
"result": "Added new record",
"record": {
"email": "jhon@gmail.com",
"is_admin": false
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
}
{
"email":"admin@gmail.com",
"password":"admin",
"data": {
"email":"jhon@gmail.com",
"password":"jhon",
"is_admin":false
}
}
{
"status": 400,
"result": {
"email": [
"users with this email already exists."
]
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
}
Method | Endpoint | Access |
---|---|---|
DELETE |
/user |
Admin |
{
"email":"admin@gmail.com",
"password":"admin",
"data": {
"email":"jhon12@gmail.com"
}
}
{
"status": 200,
"result": "Deleted record",
"record": {
"email": "jhon12@gmail.com"
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
}
{
"email":"admin@gmail.com",
"password":"admin",
"data": {
"email":"xyz@gmail.com",
}
}
{
"status": 400,
"result": "Specified record does not exists",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
}