Welcome to the Shoppies API

Github Repository

https://github.com/afairlie/shoppies_api

Available Routes

Login

POST /login

JSON: {"email": "_____", "password": "____"}

200 Response:

 
        {
          "token": "header.payload.signature",
          "username": "test",
          "nominations": {
              "id": 2,
              "1": "tt0078788",
              "2": "tt3385516",
              "3": "tt0318627",
              "4": "tt1727776",
              "5": "tt1673430",
              "user_id": 2,
              "created_at": "2021-01-11T04:46:21.982Z",
              "updated_at": "2021-01-11T04:46:21.982Z"
          }
        }
      

Sign Up

POST /users

JSON: {"email": "_____", "password": "_____", "name": "_____"}

200 Response:

        {
          "token": "header.payload.signature",
          "username": "test"
        }
      

Retrieve Nominations

GET /nominations

protected route to retrieve user nominations

headers: { authorization: 'bearer [token]' }

200 Response:

        {
          "nominations": {
              "id": 2,
              "1": "tt0068162",
              "2": "tt0296514",
              "3": "tt7259638",
              "4": "tt0197389",
              "5": "tt1700796",
              "user_id": 2,
              "created_at": "2021-01-11T04:52:22.601Z",
              "updated_at": "2021-01-11T06:32:59.048Z"
          }
        }
      

Create/Update Nominations

POST /nominations

protected route to create/update user nominations

headers: { 
            authorization: 'bearer [token]', 
            type: 'application/json' 
          }
JSON: {"1": "OmdbID", "2": "OmdbID", "3": "OmdbID", "4": "OmdbID", "5": "OmdbID"}

200 Response:

        {
          "token": "header.payload.signature",
          "nominations": {
            "1": "tt0078788",
            "2": "tt3385516",
            "3": "tt0318627",
            "4": "tt1727776",
            "5": "tt1673430"
          }
        }