Skip to content

Rest API which provides Marvel movie and series data. There are around 30+ data in the form of titles, posters, trailers, release dates, durations, genres, directors, actors, plots and download links via torrent. Rest API is built using the Laravel framework with authentication using Sanctum

Notifications You must be signed in to change notification settings

naufan17/marvel-film-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marvel Film API

API that provides data for Marvel movies and series. There are around 30+ data in the form of titles, posters, release years, trailers, release dates, durations, genres, directors, authors, actors, plots and download links via torrent.

How to setup local code program:

  • Clone this repository
  • Run this command to import database structure:
php artisan migrate
  • Run this command to start the server:
php artisan serve

API Documentation

1. Register User

  • Method: POST
  • URL Patterns: /api/register
  • Authetication: false
  • Body:
    {
      "name": Varchar,
      "email": Varchar,
      "password": Varchar
    }
  • Usage:
    curl -X POST \
    -d '{
      "name": "name",
      "email": "email", 
      "password": "password"
    }' \
    URL_Patterns
    
  • Response:
    • Success: (200)
      {
        "message": "Register successfull"
        "token": String
        "token_type": "Bearer"    
      }
    • Errors: (404)
      {
        "message": "Error"
      }

2. Login User

  • Method: POST
  • URL Patterns: /api/#
  • Authetication: false
  • Body:
    {
      "email": Varchar,
      "password": Varchar
    }
  • Usage:
    curl -X POST \
    -d '{
      "email": "email",
      "password": "password"
    }' \
    URL_Patterns
    
  • Response:
    • Success: (200)
      {
        "message": "Login successfull"
        "token": String
        "token_type": "Bearer"    
      }
    • Errors: (404)
      {
        "message": "Error"
      }

3. Get Movies

  • Method: GET
  • URL Patterns: /api/movies?title={title}&page={page}&limit={limit}
  • Authentication: false
  • Params: title or page or limit
  • Usage:
    curl -X GET
    URL_Patterns
    
  • Response:
    • Success: (200)
      {
      "status": "Success",
      "data": [
          {
              "current_page": 1,
              "data": [
                  {
                      "id": BigInt,
                      "title": Varchar,
                      "poster": Varchar,
                      "year": Year,
                      "plot": Varchar
                  },            
              ]
          }
      }
    • Errors: (404)
      { 
          "message": "Data failed to get" 
      }

4. Get Movies by Id

  • Method: GET
  • URL Patterns: /api/movies/{id}
  • Authentication: false
  • Usage:
    curl -X GET
    URL_Patterns
    
  • Response:
    • Success: (200)
      {
          "status": "Success",
          "data": {
              "title": Varchar,
              "poster": Varchar,
              "year": Year,
              "trailer": Varchar,
              "released": Varchar,
              "runtime": Varchar,
              "genre": Varchar,
              "director": Varchar,
              "writer": Varchar,
              "actors": Varchar,
              "plot": Varchar,
              "torrent": Text
          },    
      }
    • Errors: (404)
      { 
          "message": "Data failed to get" 
      }

5. Add Movies

  • Method: POST
  • URL Patterns: /api/movies
  • Authetication: true
  • Body:
    {
      "title": Varchar,
      "year": Varchar,
      "trailer": Varchar,
      "torrent": text,
    }
  • Usage:
    curl -X POST \
    -H "Authorization: Bearer <ACCESS_TOKEN>"
    -d '{
      "title": "title",
      "year": "year", 
      "trailer": "trailer",
      "torrent": "torrent"
    }' \
    URL_Patterns
    
  • Response:
    • Success: (200)
      {
          "status": "Success",
          "message": "Data stored successfully",
          "data": {
              "title": Varchar,
              "poster": Varchar,
              "year": Year,
              "trailer": Varchar,
              "released": Varchar,
              "runtime": Varchar,
              "genre": Varchar,
              "director": Varchar,
              "writer": Varchar,
              "actors": Varchar,
              "plot": Varchar,
              "torrent": Text,
              "update_at": Date,
              "created_at": Date,
              "id": BigInt,
          },    
      }
    • Errors: (404)
      {
        "message": "Error"
      }

6. Delete Movies

  • Method: DELETE
  • URL Patterns: /api/movies/{id}
  • Authetication: true
  • Usage:
    curl -X POST \
    -H "Authorization: Bearer <ACCESS_TOKEN>" \
    URL_Patterns
    
  • Response:
    • Success: (200)
      {
          "status": "Success",
          "message": "Data deleted successfully",
      }
    • Errors: (404)
      {
        "message": "Error"
      }

About

Rest API which provides Marvel movie and series data. There are around 30+ data in the form of titles, posters, trailers, release dates, durations, genres, directors, actors, plots and download links via torrent. Rest API is built using the Laravel framework with authentication using Sanctum

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published