Coder Social home page Coder Social logo

credy-movies-api-drf's Introduction

Accesing 3rd party credy API GET https://demo.credy.in/api/v1/maya/movies/

For this we have passed paswword and username from System Environment variable

with URL http://localhost:8000/credy

for pages pass page parameter http://localhost:8000/credy?page=3 http://localhost:8000/credy?page=5


To Register USER and get acces token(change password from admin panel to change raw password there and to use it) :-

POST http://localhost:8000/register/ input :-

{ “username”: , “password”: }

example :- { "username":"pankaj", "password":"pankaj@123" }

output :- { "access_token":"XXXXX", }

example :- { "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo3LCJ1c2VybmFtZSI6InBhbmthaiIsImV4cCI6MTY2NjM1MTI2MiwiZW1haWwiOiIifQ.zf30V0piPod5BlSgjBojQr6q98cJ9U0zubgyjgRPToU" }

http://localhost:8000/api/token/

input

{ "username":"abvppp", "password":"rajromeo10" }

output

{ "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY2NzY0ODI3MSwiaWF0IjoxNjY2MzUyMjcxLCJqdGkiOiI0ZjQ5OGIyMDhlMGY0NDY1YjZmYjYxYTQ3NTcyYWYzNyIsInVzZXJfaWQiOjEwfQ.JVZBa7YSvpoXkqo42sP7X00fihA4HQzpWsjttNNrC1c", "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjY3NjQ4MjcxLCJpYXQiOjE2NjYzNTIyNzEsImp0aSI6IjUzNGY5ZDk2NzgzNjRmMDA4Njg1ZTM1MTI2ZjFjNjYxIiwidXNlcl9pZCI6MTB9.MXyMolNfvsCDFsMx2wP7onpCEe4gSykBIEpGAffsi6s" }

Copy Above acces token And add everytime when we make any Request ( As Barear Token)

Get All movies from Database

Get http://localhost:8000/movies Output:-

{ "count": 1, "next": null, "previous": null, "results": [ { "title": "Dhoom3", "description": "jdjdjdjdj", "genres": "drama", "uuid": "dfadf0a6-f5c4-48fb-929a-5cd534873ee4" } ] }

Get Movie By UUID

GET http://localhost:8000/movie/7a5fd364-b4d4-457d-8bb6-2e6475eb391c/

OUTPUT:-

{ "title": "Dhoom3", "description": "jdjdjdjdj", "genres": "drama", "uuid": "dfadf0a6-f5c4-48fb-929a-5cd534873ee4" }

GET COLLECTION http://localhost:8000/collection/

Output

[ { "uuid": "0388d6c9-63e4-4170-8cf9-65a220822d20", "title": "Collection1", "description": "This is sample Collection1 .", "movies": [ { "uuid": "dfadf0a6-f5c4-48fb-929a-5cd534873ee4" } ] }, { "uuid": "513beb49-8eef-4127-9aee-6cbef8de5a3a", "title": "Collection2", "description": "This is Sample Collection 2", "movies": [] } ]

GET COLLECTION BY UUID http://localhost:8000/collection/0388d6c9-63e4-4170-8cf9-65a220822d20

OUTPUT :- { "uuid": "513beb49-8eef-4127-9aee-6cbef8de5a3a", "title": "Collection2", "description": "This is Sample Collection 2", "movies": [] }

POST COLLECTION POST http://localhost:8000/collection/

OUTPUT:-

{ “title”: “<Title of the collection>”, “description”: “”, “movies”: [ { “title”: <title of the movie>, “description”: , “genres”: , “uuid”: }, ... ] }

UPDATE COLLECTION PUT http://localhost:8000/collection/<collection_uuid>/

INPUT:- { “title”: , “description”: , “movies”: , }

DELETE COLLECTION DELETE http://localhost:8000/collection/<collection_uuid>/

CREATED CUSTOM MIDDLEWARE :- RequestCounterMiddleware

TO COUNT REQUEST http://localhost:8000/request-count

TO RESET COUNT:- http://localhost:8000/request-count/reset/

credy-movies-api-drf's People

Contributors

rajparmarr2308 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.