-
Notifications
You must be signed in to change notification settings - Fork 0
API
URL: https://sposmen-cinema.herokuapp.com/v1
Headers:
Content-Type:application/json
Method: POST
Endpoint: /v1/movies
Attributes:
-
name: Name of the Movie (Required) -
description: Description of the movie -
image_url: Movie image -
days_show: Boolean array of week days when the movie is shown Monday to Sunday (Required)e.g.: If the movie is shown on Monday, Wednesday and Friday the array is
[true, false, true, false, true, false, false]
Request example:
Body:
{
"name": "Gone with the Wind",
"description": "A manipulative woman and a roguish man conduct a turbulent romance during the American Civil War and Reconstruction periods.",
"image_url": "https://m.media-amazon.com/images/M/MV5BYjUyZWZkM2UtMzYxYy00ZmQ3LWFmZTQtOGE2YjBkNjA3YWZlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SY1000_CR0,0,652,1000_AL_.jpg",
"days_shown": [true, false, true, false, true, false, false]
}On Success Response example:
HTTP Response code: 201
Body:
{
"id": 7,
"name": "Gone with the Wind",
"description": "A manipulative woman and a roguish man conduct a turbulent romance during the American Civil War and Reconstruction periods.",
"image_url": "https://m.media-amazon.com/images/M/MV5BYjUyZWZkM2UtMzYxYy00ZmQ3LWFmZTQtOGE2YjBkNjA3YWZlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SY1000_CR0,0,652,1000_AL_.jpg",
"days_shown": [
true,
false,
true,
false,
true,
false,
false
]
}On Error Response example:
HTTP Response code: 4xx
Body for general error:
{
"error": "days_shown is missing"
}Body for specific error:
{
"image_url": [
"is not a valid URL"
]
}Method: GET
Endpoint: /v1/movies/search
Query Params: day (Required)
URL Example: /v1/movies/search?day=1. This request movies being shown on tuesdays
On Success Response example:
HTTP Response code: 200
Body: The result is an array of movies
[
{
"id": 7,
"name": "Gone with the Wind",
"description": "A manipulative woman and a roguish man conduct a turbulent romance during the American Civil War and Reconstruction periods.",
"image_url": "https://m.media-amazon.com/images/M/MV5BYjUyZWZkM2UtMzYxYy00ZmQ3LWFmZTQtOGE2YjBkNjA3YWZlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SY1000_CR0,0,652,1000_AL_.jpg",
"days_shown": [
true,
false,
true,
false,
true,
false,
false
]
}
]Method: POST
Endpoint: /v1/movie_reserves
Attributes:
-
movie_id: ID of the movie (Required) -
date: wanted Date to add the reservation -
person_name: Name of the person to own the reservation
Request example:
Body:
{
"movie_id": 7,
"date": "2019-09-23",
"person_name": "John doe"
}On Success Response example:
HTTP Response code: 201
Body:
{
"movie_id": 8,
"date": "2019-09-23",
"person_list": [
"John doe"
]
}On Error Response example:
HTTP Response code: 4xx
Body for general error:
{
"error": "days_shown is missing"
}Body for specific error:
{
"error": "Allowed occupancy raised. Sorry"
}Method: GET
Endpoint: /v1/movie_reserves/search
Query Params:
-
from: Date (Required) -
to: Date (Required)
URL Example: /v1/movie_reserves/search?from=2019-09-23&to=2019-09-25. This request movies being shown on tuesdays
On Success Response example:
HTTP Response code: 200
Body: The result is an array of movies
[
{
"movie_id": 7,
"date": "2019-09-23",
"person_list": [
"John doe",
"Mrs. Latia Gislason"
]
},
{
"movie_id": 8,
"date": "2019-09-23",
"person_list": [
"Johnsie Marquardt"
]
}
]As ping status there is an alternative ping method that could help for get status. For local environment (and future helper) convenient branch and commit info are set.
Endpoint: /v1/ping
Method: GET
Response Example:
{
"ping": "pong",
"branch": "master",
"commit": "7f4acb6"
}Made by Jaime Giraldo