Movies

Manage movies in the streaming platform.

List Movies

GET /api/v1/movies

Response

{
    "data": [
        {
            "movie_id": 1,
            "title": "The Shawshank Redemption",
            "year": 1994,
            "duration": 142,
            "imdb_rating": 9.3,
            "status": "published",
            "category": {
                "id": 1,
                "name": "Drama"
            },
            "poster": "https://api.dobridobrev.com/storage/movies/1/poster.jpg"
        }
    ],
    "links": {
        "first": "https://api.dobridobrev.com/api/v1/movies?page=1",
        "last": "https://api.dobridobrev.com/api/v1/movies?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "per_page": 15,
        "to": 1,
        "total": 1
    }
}

Get Movie

GET /api/v1/movies/{movie}

Path Parameters

Parameter Type Required Description
movie integer Yes Movie ID

Response

{
    "data": {
        "movie_id": 1,
        "title": "The Shawshank Redemption",
        "year": 1994,
        "duration": 142,
        "imdb_rating": 9.3,
        "status": "published",
        "category": {
            "id": 1,
            "name": "Drama"
        },
        "poster": "https://api.dobridobrev.com/storage/movies/1/poster.jpg",
        "description": "Two imprisoned men bond over a number of years...",
        "backdrop": "https://api.dobridobrev.com/storage/movies/1/backdrop.jpg",
        "persons": [
            {
                "id": 1,
                "name": "Frank Darabont",
                "pivot": {
                    "role": "director"
                }
            }
        ],
        "trailers": [
            {
                "id": 1,
                "url": "https://youtube.com/watch?v=..."
            }
        ],
        "images": [
            {
                "id": 1,
                "type": "poster",
                "url": "https://api.dobridobrev.com/storage/movies/1/poster.jpg"
            },
            {
                "id": 2,
                "type": "backdrop",
                "url": "https://api.dobridobrev.com/storage/movies/1/backdrop.jpg"
            }
        ]
    }
}

Create Movie

POST /api/v1/movies

Request Body

Parameter Type Required Description
title string Yes Movie title (max 128 characters, must be unique)
slug string No URL-friendly title (max 128 characters)
description string Yes Movie description
year integer Yes Release year
duration integer No Duration in minutes
imdb_rating numeric No IMDB rating (between 0 and 10)
premiere_date date No Premiere date
status string Yes Movie status (published, draft, sheduled, coming soon)
category_id integer Yes Category ID
persons array No Array of person IDs
trailers array No Array of trailer objects with URL
video_files array No Array of video file objects with URL
image_files array No Array of image file objects with URL

Response

{
    "data": {
        "movie_id": 1,
        "title": "The Shawshank Redemption",
        "year": 1994,
        "duration": 142,
        "imdb_rating": 9.3,
        "status": "published",
        "category": {
            "id": 1,
            "name": "Drama"
        },
        "poster": "https://api.dobridobrev.com/storage/movies/1/poster.jpg"
    }
}

Update Movie

PUT /api/v1/movies/{movie}

Path Parameters

Parameter Type Required Description
movie integer Yes Movie ID

Request Body

Same as Create Movie endpoint.

Response

Same as Create Movie response.

Delete Movie

DELETE /api/v1/movies/{movie}

Path Parameters

Parameter Type Required Description
movie integer Yes Movie ID

Response

{
    "message": "Movie deleted successfully"
}