NAV

Introduction

JSON API for managing movie information.

Movies

Create a Movie

Create a movie

curl --request POST localhost:7220/api/v1/movies \
--data @<(cat <<EOF
{
	"title": "Black Panther",
	"year": 2018,
	"runtime": "134 mins",
	"genres": ["sci-fi", "action", "adventure"]
}
EOF
)

This endpoint creates a new movie.

HTTP Request

POST localhost:7220/api/v1/movies

Request Data

Get Specific Movie

Get movie having ID 1

curl --request GET -i https://cineapi.src.saurabh.sm/api/v1/movies/1

The above command returns the following JSON

{
	"movie": {
		"id": 1,
		"title": "Blade Runner 2049",
		"year": 2017,
		"runtime": "164 mins",
		"genres": [
			"drama",
			"science fiction"
		],
		"version": 1
	}
}

This endpoint retrieves a movie by ID

HTTP Request

GET https://cineapi.src.saurabh.sm/api/v1/movies/<ID>

URL Parameter

Parameter Description
ID The ID of the movie to retrieve