This page shows some fun queries to illustrate what might be possible using the basics of the REST API to illustrate some powerful combinations. MOre examples may be added as people looks for solutions.
A List of Ticket for an event
This shows a list of tickets purchased for an event, the people who bought it and the order total.
A List of orders for an event
This is a summary of people buying tickets for an event - the purchasers are grouped by order.
- The endpoint is tickets since we need to be looking for tickets, since patrons, performances, events and orders are all related to the purchased ticket
https: //127.0.0.1/api/v1/tickets?
- The query is : patron >0, order >0 and event 61 or q=patron_id:>0+order_id:>0+event_id:[61]
- the fields that are grouped are: event title, series, date, patron id, name, order id, somewhat similar to the above query
group=event.title+performance.series_code+performance.perform_datetime+patron.id+patron.first_name+patron.last_name+patron.formal_name+order_id
- however, some data that is repeated can best be shown if it is aggregated such as:
- sum of ticket quantity and total cost (since this is per ticket values)
- minimum of total amount and order balance (we use the minimum to get the value once per order)
agg=sum(quantity):ticket_count+sum(total_cost):ticket_total+min(order.total_amount):order_total+min(order.balance):order_balance
- Full REST API query is:
https://127.0.0.1/api/v1/tickets?q=patron_id:>0+order_id:>0+event_id:[61]&group=event.title+performance.series_code+performance.perform_datetime+patron.id+patron.first_name+patron.last_name+patron.formal_name+order_id&agg=sum(quantity):ticket_count+sum(total_cost):ticket_total+min(order.total_amount):order_total+min(order.balance):order_balance
Primary phone numbers for a patron with locations