REST API demo

You are welcome to try out the new solutions.


For mobile app

Easy integration with any existing platform by JSON-enquiries


For your site

This will allow you to realize a single-page app

This will allow you to realize a single-page app.

Api documentation: http://rest-demo.glavweb.ru/api/doc

Login to administration system: http://rest-demo.glavweb.ru/admin

Users:

  • Administrator. Group: administrators. Login: admin, password: qwerty
  • Moderator. Group: moderators. Login: moderator, password: qwerty
  • User 1. Group: users. Login: login: user-1, password: qwerty
  • User 1. Group: users. Login: login: user-2, password: qwerty

Entities

Entities and fields of entities are selected in such a way that allows to use api possibilities to the greatest extent.

The following entities are available:

  • Movie. Movies.
  • MovieDetail. Detailed information about the film.
  • MovieSession. Screenings.
  • MovieGroup. Movie groups.
  • MovieComment. Comments for movies.
  • Image. The images used in comments.
  • Article. Articles.
  • Tag. Tags.

There are the following connections between them:

  • one-to-many (movie shows, comments);
  • many-to-one (group of films);
  • many-to-many (tags);
  • one-to-one (info about a movie).

Additional features:

  • Not-posted comments are visible for their authors only.
  • Administrators and moderators can see all comments.
  • Comments created by the user from administrator or moderator group is posted automatically.

User groups

  • Administrators. Have full access to all entries in administration system.
  • Moderators. Have limited access to administration system (can edit or delete comments).
  • Users. Do not have access to administration system. Users can add new comments, edit or delete own comments using app’s api.

Scripts

Script 1.

The user is not authorized. He/she can view all movies and comments approved by moderators. The user cannot create comments and has no access to administration system.

Script 2.

The user is authorized and belongs to "User" group. He/she can view own comments and comments approved by moderators. The user can create comments and attach images to comments; can edit and delete the comments. The administration system is not accessible.

Script 3.

The user is authorized and belongs to "Moderator" group. He/she can view all movies and comments. The moderator can create comments and attach images to comments, can edit and delete any comments. The moderator has limited access to administration system - access to comments only.

Script 4.

The user is authorized and belongs to "Administrator" group. He/she can view all movies and comments. The administrator can create comments and attach images to comments, can edit and delete any comments. The administrator has access to all possibilities of administration system.

Examples of enquiries

View all articles, except of entries of "photo_report" type:

GET /api/articles?_oprs[type]=<>&type=photo_report

View all articles sorted by name (from the last to the first letter) and ID (from smaller to greater):

GET /api/articles?_sort[name]=DESC&_sort[id]=ASC

View all entries after 11th:

GET /api/articles?_offset=10

View the first 10 articles:

GET /api/articles?_limit=10

View all articles that name contains "Dolorem":

GET /api/articles?name=Dolorem

View all articles that name does not contain "Dolorem":

GET /api/articles?name=!Dolorem

View articles that names are "Dolorem eaque libero maxime":

GET /api/articles?name==Dolorem+eaque+libero+maxime.

View articles that names are not "Dolorem eaque libero maxime":

GET /api/articles?name=<>Dolorem+eaque+libero+maxime.

View all articles with enum type "news":

GET /api/articles?type=news

View articles of "photo_report" and "news" type:

GET /api/articles?type=["photo_report","news"]

View all articles except of "new" and "photo_report":

GET /api/articles?_oprs[type]=<>&type=["photo_report",+"news"]

View articles created later 2016-06-07:

GET /api/articles?publishAt=>2016-06-07

View articles created before 2016-06-07:

GET /api/articles?publishAt=<2016-06-07

View articles created within the period from 2016-03-06 to 2016-03-13:

GET /api/articles?publishAt=[">2016-03-06","<2016-03-13"]