Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /home/jesalb9/albrechtjess.net/drupal/includes/menu.inc).

Restful Web API

  • Posted on: 10 March 2016
  • By: albrechtjess

Movies API Documentation

http://albrechtjess.net/assignments/moviesAPI/moviesApi.php

All returns are in JSON

JSON will return with labeled sectors. Returned values include Query Parameters for an element of the database, count, and strings with information

Query Parameters

Title - type: String - The title of the movie.

Year - type: int - The year the moview was released.

Studio - type: String - The studio that produced the movie.

Price - type: Decimal - The price of the movie ticket.

id - type: int - The id of the movie in the database.

Supported Requests

GET

  • No parameters will return all movies
  • id - parameter will return the movie with that id
  • search - will search for movies with the Title or Studio of the search term
  • count - if count is sent as "true" it will return the count of the Get rather than the data elements

POST

  • Requires: Title, Year, Studio, Price
  • Will add a movie to the database with the supplied parameters
  • Check Query Parameters for format

PUT

  • Requires: Title, Year, Studio, Price, id
  • Will update the movie in the database at the id specified with the supplied parameters
  • If the id does not exist it will add the movie with the supplied id

DELETE

  • Requires: id
  • Will remove the movie in the database at the id specified

OPTIONS

  • Will list the supported request options