You are here

REST API Top Level Endpoints

Subscribe to Syndicate
When you see the window below, you have successfully accessed the API. This shows a list of the endpoints -- which is a URL that:
  • will give you specific information that relates to the link. eg there is a patron end point that provides information about the patron and a ticket end point that focuses on ticket information
  • can be modified to only select specific columns
  • can have a sort order provided and data will return in that order
  • can have a query provided to only select data that you want
  • can also show some associated data (eg ticket date can show the patron, event and performance it is for

The end points are show in this manner so that they are discoverable. This means you can follow any one of them and see what kind of information it provides and can discover where it will lead.

 

Key columns in the top level endpoint list

Column Purpose
type This is one of
  • meta - which indicates that type of URL will describe something - i.e. meta data
  • data - the url will show actual data from the database
endpoint This is the endpoint name that can be added to the base url of the API to show the data. They are generally self describing and are case-sensitive.

For example, the endpoint carts will provide a list of shopping carts when added to the URL such as

https://127.0.0.1/api/v1/carts

data_url The data_url is provided so that you can easily click on the endpoint and see data from the database, if you are permitted to see that data within the Theatre Manger database as an employee. For the carts endpoint, the data_url is the same as above, i.e.

https://127.0.0.1/api/v1/carts

pages_url When the word pages is added to the data_url, the API will send the data back as pages of information with a default 25 lines of data per page. You can use next and previous to page through the data. For example

https://127.0.0.1/api/v1/carts/pages

You can navigate directly to a page of information by adding a ?page=x parameter (other parameters are discussed later). For example:

https://127.0.0.1/api/v1/carts/pages?page=2

schema_url If the word schema is added to the data_url, the API will provide a description of the columns in the particular endpoint. Using the carts endpoint as an example, the URL will be:

https://127.0.0.1/api/v1/carts/schema

Example of schema descriptions for Carts:

apps Shows the version of the applications supported by the current TM server

https://127.0.0.1/api/v1/apps