Skip to content

A netflix server api for registering subscribers, saving new movies, allowing subscribers to suggest their own movies or delete them.

Notifications You must be signed in to change notification settings

IdahK/netflix_server_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consuming the api

Register subscribers

URL : /subscribers

Method : post

Body

{
    "fullname": "Jane Doe",
    "identificationNumber": "54321"
}

Responses

  1. If a new user
    {
        Subscriber:54321 saved
    }

2.. If user is already registered

    {
        Subscriber:5233 already registered.Cannot register again
    
    }

View categories

URL : /categories

Method : get

Response

[
    {
        "id": 1,
        "categoryName": "Comedy"
    },
    {
        "id": 2,
        "categoryName": "Animation"
    },
    {
        "id": 3,
        "categoryName": "Drama"
    },
    {
        "id": 4,
        "categoryName": "Action"
    }
]

Movies

Search movies

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"
                }
            ]
        }
    ]

Search movies by Category and Type

URL: /movies/{categoryId}

METHOD: GET

Request Parameter: type= <suggested/original>

  http://localhost:9000/movies/2?type=original

Check here: https://github.com/94658/netflix_server_api/blob/master/src/main/java/com/group/netflixserverapi/images/Capture.PNG

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"
            }
        ]
    }
]

Suggest/add movies for subscribers

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"
        }
    ]
}

Update movie for subscribers' own content

URL: /movies/{movieId}

METHOD: PATCH

Request Header: "identificationNumber"

Body

About

A netflix server api for registering subscribers, saving new movies, allowing subscribers to suggest their own movies or delete them.

Topics

Resources

Stars

Watchers

Forks

Languages