-
Notifications
You must be signed in to change notification settings - Fork 2
Sample API Requests
AFM Sayem edited this page Sep 8, 2018
·
5 revisions
- Get all the movies -
/movies
: http://gz-movies.herokuapp.com/movies - Get all the types -
/types
: http://gz-movies.herokuapp.com/types - Get all the persons -
/persons
: http://gz-movies.herokuapp.com/persons - Get all the movies of a director -
/movies?where[director_id:eq]=<directorId>
: http://gz-movies.herokuapp.com/movies?where[director_id:eq]=3 (Ridley Scott) - Get all the movies that were relased in a time frame -
movies?where[released:gt]=<from>&where[released:lt]=<to>
: http://gz-movies.herokuapp.com/movies?where[released:gt]=2014-01-01T00:00:00.000Z&where[released:lt]=2016-01-01T00:00:00.000Z - Search movie titles -
/movies?where[title:search]=<search_text>
: http://gz-movies.herokuapp.com/movies?where[title:search]=Martian - Search movie titles with spelling mistake -
/movies?where[title:search]=<misspelled_search_text>
: http://gz-movies.herokuapp.com/movies?where[title:search]=Martan
- Include a related information -
/movies?include=[<relation>]
: http://gz-movies.herokuapp.com/movies?include=[director] - Include multiple related information -
movies?include=[<relation1>, <relation2>]
: http://gz-movies.herokuapp.com/movies?include=[director,artists]
- Order by a property -
/movies?sort=<property>
: http://gz-movies.herokuapp.com/movies?sort=released - Order by a property in descending order -
/movies?sort=-<property>
: http://gz-movies.herokuapp.com/movies?sort=-released
- Define page size -
/movies?page[size]=<page_size>
: http://gz-movies.herokuapp.com/movies?page[size]=2 - Jump to a page -
/movies?page[number]=<page_number>
: http://gz-movies.herokuapp.com/movies?page[size]=2&page[number]=1