REST API full syntax
REST API full syntax
The full syntax of the REST API for is shown below. This summarizes how to use it within Theatre Manager. The following conventions are used:
- [ item ] - means that this part of the syntax is optional
- [item, ....] - means that the item can be repeated
- item1 | item2 - means you can use either Item1 or Item2 in the syntax
https://RestServerURL/api/v1 [/endpoint]
Putting it all together
the following examples show some of the power of the api to get exactly what you want.
- https://127.0.0.1/api/v1/patrons?only=first_name+last_name+company&sort=last_name+first_name
retrieve first, last and company fields from the patrons endpoint and sort by last name, then first name - https://127.0.0.1/api/v1/patrons?only=first_name+last_name+company&sort=last_name+first_name&q=-last_name:smith
retrieve only first, last and company from the patrons endpoint and sort by last name, then first name. use a query to eliminate any patron with the last name smith from the list. - https://127.0.0.1/api/v1/patrons?only=first_name+last_name+company&sort=last_name&q=last_name:smith
retrieve first, last and company from the patrons endpoint, sort by last name. use a query to eliminate any patron with the last name smith from the list. - https://127.0.0.1/api/v1/patrons?only=first_name+last_name+company&sort=last_name&q=last_name:smith
retrieve first, last and company from the patrons endpoint, sort by last name only searching for people called 'smith' and exporting as JSON format - https://127.0.0.1/api/v1/carts?q=status_id:4&only=date_checkout+order_id+patron_id+total_cost+order_notes&sort=-date_checkout
get a list of all checked out shopping carts (status_id=4) and sort them in descending order by checkout date