The data can be delivered in a number of formats like plain text, (tab and comma delimited), JSON, EXCEL, HTML and some graphical formats.
The data from the REST api can be used on a marketing web site to push the user over to the bootstrap based commerce pages provided by Arts Management, using links, as described in this documentation page. |
Note: At this time, the web store password is probably different than the employee's Theatre Manager login account since they can set it themselves online.
We recommend informing staff who are given access to the REST API to use complex passwords (or if you wish, make it mandatory). Since most people will not the API enabled for their employee account, they would be largely unaffected. |
The email address and password for the REST APR are the SAME as the email address and password for logging into the ticket web site.
For first time users:
|
https://tickets.yourvenue.org/api/v1
all examples use https://127.0.0.1/api/v1 as the example. please replace with your web site URL.
The server will respond with a login screen where you provide:
myemail@venue.org
Note: if you have multiple logins in an outlet version of TM so there is ambiguity as to who you are, you may need to type your email address followed by:
myemail@venue.org;outlet=xx
-and/or-myemail@venue.org;outlet=xx;patron=yy
If you get your password wrong, you will see the login window again.
If you get your password correct, but are not enabled to use the API in your employee preferences, you will see a message similar to the one of the right that says API Access Disabled
You will need to enable API access to continue. |
If you see the window below showing a list of the top level end points, you have successfully accessed the API.
Just having access to the rest api does not mean you can see the database. The permissions set for the employee in the Data Tab in employee preferences limit the data which the employee can see in the API endpoints.
If you see the message to the right, it could simply mean no permission has been provided as shown below. |
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.
Remember to replace 127.0.0.1 in the example urls https://127.0.0.1/api/v1 with your web site URL (eg tickets.yourvenue.org) | |
https://127.0.0.1/api/v1 will give you the top level endpoints for the entire schema. |
Column | Purpose |
type |
This is one of
|
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 |
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. |
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: |
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 |
However, if you would like the images that are on web pages, please refer to Accessing Images. With this you can show images that are in Theatre Manager on other web pages just be referring to them with the Theatre Manager build in URL.
If you are going to use those images in a front end marketing web site (eg wordpress or what have you), then we also suggest creating an image cache that is refreshed periodically to help lower the actual traffic to the commerce part of the web site.
Some example output formats are below and they may be supplemented as need be:
It is very easy to use one of the other output formats. For example, to request that the output be in json format, simply add .json to the url.
After logging in to the REST API, try the following examples to get the sample page above in different formats:
This applies to all URL's in the REST API - using carts for example:
You can:
q=first_name:john+last_name:smith+-company:ibm
You can:
Conditions used in queries vary based on variable type. The following is a generalized list:
Variable Type | parameter in URL | Meaning |
Numeric | field:value | field equals value (null can be used as value) |
field:>value | field greater than value | |
field:>=value | field greater than or equal to value | |
field:<value | field less than value | |
field:<=value | field less than or equal to value | |
field:value1..value2 | field must be between value1 and value2 | |
field:[value1, value2, value3] | field must be one of value1, value2 or value3
No space is required because fields are numeric |
|
Character | field:=value | field equals value using case sensitive match (null can be used as value).
eg first_name:=Bob will find Bob, but not bob |
field:='value' | field equals value using case sensitive match and where value can have spaces
eg first_name:='Bob and Betty' will find Bob and Betty, but not bob And Betty |
|
field:*value* | field contains value where * is a wildcard that marches any characters (case insensitive) before and/or after value.
eg first_name:*bob* will find Bob, bob, bobby, and bebob |
|
field:value | field is like the value using case insensitive search
eg first_name:bob will find Bob, bob but not bobby |
|
field:'value' | field is like the value using case insensitive search where value can have spaces
eg first_name:'bob 5' will find Bob 5, bob 5 but not bobby |
|
field:[value1, value2, value3] | field is one of value1 or value2, or value3 (case insensitive).
eg first_name:[bob, ted, alice] will find bob, Bob, ted, tED, AliCe note: a space is required after each comma |
|
field:[value1*, value2*, value3] | field is one of value1 or value2, or value3* (case insensitive and value3 starts with)
eg first_name:[bob, ted, ale*] will find bob, Bob, ted, alex, alecia, alexandra note: a space is required after each comma |
|
field:=[value1, value2, value3] | field is one of value1 or value2, or value3 (case sensitive).
eg first_name:=[Bob, Ted, alice] will find Bob, Ted, Alice, bur not bob, ted or alice |
|
field:[value1, value2, value3] | field is like one value1, value2, or value3 (case insensitive). This uses postgres 'ilike' comparator
eg first_name:[Bob, Ted, alice] will find Bob, Ted, Alice, bob, ted, alice, teddy, bobbie, boBBie, fested ... note: a space is required after each comma |
|
search:["value1", "value2"] | does a postgres text search on the data in the endpoint.
eg search:["Bob", "art"] will find Bob, Bobbie, Art and Arts Management Systems (searches in all name and company fields"). |
|
Boolean | field:value | field equals, which is either true, false or null |
Date | field:value | field equals value, value specifed in yyyy-mm-dd format, or null |
field:>value | field greater than value in yyyy-mm-dd format | |
field:>=value | field greater than or equal to value in yyyy-mm-dd format | |
field:<value | field less than value in yyyy-mm-dd format | |
field:<=value | field less than or equal to value in yyyy-mm-dd format | |
field:value1..value2 | field must be between value1 (yyyy-mm-dd format) and value2 (yyyy-mm-dd format) | |
field:[value1, value2, value3] | field must be one of value1 (yyyy-mm-dd format), value2 (yyyy-mm-dd format) or value3 (yyyy-mm-dd format) |
These are special de-normalized lists of record connections. Examples of these fields are 'bought for plays', 'belongs to mail lists', 'associated with tags' where the specific record can be associated with multiple other records. A patron can belong to many mail lists. A play, donation campaign, or patron can be associated with many tags and searching for records with these markers can provide access to an arbitrary group of data, such as searching for all events with a tag.
Packed Lists | field:[value1, value2, value3] | field is one of value1, value2 or value3 where all values are internal record numbers that you would have found by some other means.
eg tag_ids:[5,6,7] will find all records with tag ids of 5, 6 or 7 |
field:=[value1, value2, value3] | field contains all seq #s of value1, value2 or value3 where all values are internal record numbers that you would have found by some other means.
eg tag_ids:=[5,6,7] will find all records marked with tag ids of 5, 6 and 7 |
A quick way to see a sample of data is to use page=1. When you display a page, you will have next and previous on the html page so that you can navigate to next or previous pages easily.
There are some parameters that you can use to limit the amount of data:
Each column you want to see in your output is separated with a + (plus sign)
Examples:
patron.id:patno renames patron.id to patno on output
renames:
adds
adds a compound query:
subtly changes the previous example by:
The starting place is finding what data is related to a particular endpoint using the related feature. The following shows:
Examples are:
https://127.0.0.1/api/v1/orders/related
Other Examples:
group=round(date_bought,1,month):purchase_date&agg=count+sum(total_cost)+avg(total_cost)
The group= allows you to summarize by text, number, boolean and date fields. You can also provide a function to summarize by parts of a date field.
Query Breakdown:
Params are broken up by the ampersand &
Examples
https://RestServerURL/api/v1 [/endpoint]
the following examples show some of the power of the api to get exactly what you want.
This shows a list of tickets purchased for an event, the people who bought it and the order total.
only=event.title+performance.series_code+performance.perform_datetime+patron.id+patron.first_name+patron.last_name+patron.formal_name+order.id+order.total_amount+order.balance
This is a summary of people buying tickets for an event - the purchasers are grouped by order.
https: //127.0.0.1/api/v1/tickets?
group=event.title+performance.series_code+performance.perform_datetime+patron.id+patron.first_name+patron.last_name+patron.formal_name+order_id
ICS files are convenient ways to share calendar information and can be done in two ways:
|
The following links may assist you to link or subscribe to a Theatre Manager ICS calendar using you calendar. IF the links are not correct or ut of date, please use Google to search for Subscribing to calendars with ... to see if it helps.
Wikipedia publishes a list of calendar applications with ICS support. This might be helpful getting started with calendar integration.
The subscriber to a calendar may have to set the refresh time in the calendar - See iCal example |
These include:
The parameters are optional:
The sample calendar was pulled from our test database as an ICS file. It was opened in iCal to show the content:
Please refer to the REST API introduced in Dec 2016. The REST API replaces this feature while providing more control over who can access data.
However, while exportevents still works on TM 10.07.xx, its use may be deprecated in the future depending on use. |
This feature (we suggest using the REST API going forward) can be used to export event details using an https request exportevents if you are using Theatre Manager's online sales. Online sales are a central location of data displaying details for upcoming events.
This data can be used to feed web pages specific information, such as titles, dates, times and ticket availability (e.g. good, limited, sold out, etc.) of events. The data is presented in an XML style layout and can be customized so the tags are compatible with how you want them exported.
You can use the extracted information to publish data from TM into a custom calendar object and automate creation of buy now links. |
The address used to view the export is:
https://tickets.yourvenue.org/TheatreManager/1/exportevents (** deprecated)
NOTE: Refer to the REST API equivalent showing event id, name and sales notes.
where:You can preview this information in a browser prior to programming a custom interface. To review the data, right click on the displayed list and select View Source. This will display the beginning and ending XML tags for each field and a <br> tag after each set of record rows. A sample of the data is below:
You can reformat data to appear in a different order. Fields can be removed or additional event and performance related fields added. Calculations can be set based on existing data to provide required information for customized fields. Some of the field references are:
TM_SEQ - Map Number
TM_MAP_NAME - Map Name
P_SEQ - Event Number
P_PLAY_TITLE - Event Title
PB_SEQ - Performance Number
PB_SHOW_CODE - Event Code
PB_SERIES_CODE - Performance Code
PB_PERF_NOTE - Performance Notes
F_SOLD_PERCENT - Percent of Seats Sold for this Performance
PB_PERFORMANCE_DATE - Performance Date
PB_PERFORMANCE_TIME - Performance Time
To alter the information exported, you need to edit rowTicketEventExportCustom.html
You can have have several variations of this page to be used for different exports. When a desired format is required, the page names can be altered so the required export is using the name rowTicketEventExportCustom.html.
The rowTicketEventExportCustom.html page is referenced by the TMticketsExportCustom.html page.
The export address can be altered to include or exclude certain information.
For example:
This export address will export only information for Event number 246 if it takes place in venue 18, is in the year 2012 and is available for sale online.
Additional options that can be added to the address are listed below:
&year=YYYY - displays the performances for the specific year where YYYY is the desired year
&event=X - displays the performances for the specific event where X is the event sequence number from Theatre Manager
&venue=Z - displays the performances for the indicated venue only, where Z is the venue sequence number from Theatre Manager
&abletosell=1 - displays ONLY the events available for sale online (this is the default if not supplied)
&abletosell=0 - displays events that are available for sale and/or those events that are not yet available for sale online
This shows events that a patron has purchased a part of their web checkout. It requires an authentication token to be created if you want to subscribe to it. Otherwise, it can be viewed online if the patron is logged in.
This shows this list of volunteer or staff activities assigned to a patron. it can be accessed as:
The parameters are optional:
For example:
This feature is available to anybody involved with your venue and who can log into the website.
To keep a private calendar up to date in your tool of choice (eg iCal, Outlook, calendar on a phone), you will need to do the following three stems one time only:
If you do not want your calendar linked to Theatre Manager and receive automatic updates, you can get the calendar data into your device by:
There are two ways to subscribe to the calendar:
Subscribing takes three steps:
On some devices (and operating systems), subscribing to a calendar may take a few manual steps. This example shows how to do these steps with iCal. If you are using a different calendar program like outlook, or an older android device, you may have to do these steps manually.
tickets.yourvenue.org/TheatreManager/1/calendars/my_upcoming_events.ics?t=personal_token
where:
By default, a new calendar that you subscribe to in iCal will update itself weekly, so change that to 5 minutes. If you make a mistake and do not set the calendar frequency to 5 minutes, you can change it later by clicking on the calendar on the right side of iCal, and doing a right click-get info.