|
|
Introduction
This API can be used to programmatically pull data out of ExhibitDay or push data into ExhibitDay -- allowing for automation between ExhibitDay and your internal systems (or other third-party software). To use the API, you'll need working knowledge of consuming REST APIs.
Prerequisite
An API Key is required in order to make API calls. You can obtain your API Key from your ExhibitDay account (under Workspace Settings > API & Integrations > API Access).
Methods and Parameters
There are 3 ways you can pass in the parameter(s) for a method when making an API call:
Pro tip: you can mix-and-match where the parameters are placed in the request. For example, the api_key parameter (which is a required parameter of every API method) can be placed in the request Header and all other parameters can be placed in the request Body.
Parameter values are text, numbers, true/false or null. A JSON array or object is refused with 400 (error_code invalid_request), with two exceptions: event_tags also accepts an array of tag names, and amount_cost_center_breakdown is the JSON array shown in its description. A request body can be at most 10 MB.
Updating and Clearing Values
When you update an object (e.g., an event or a task), only pass in the parameters that you want to change. Any parameter you don't pass in is left unchanged.
Example (remove the due date of the task that has a taskid of 12345; the empty details value leaves the task's details unchanged):
curl -X PATCH https://api.exhibitday.com/v1/tasks -H "Content-Type: application/json" -d "{\"api_key\":\"YOUR_API_KEY\", \"id\":\"12345\", \"due_date\":null, \"details\":\"\"}"
Response:
{"status_code":200,"status":"OK","message":"Task Update Successful. Task properties that were changed: due_date","errors":[],"warnings":["details was empty, so it was left unchanged. To clear it, send null."]}
Note: when you add an object (e.g., with a POST call), passing in null is the same as leaving the parameter out.
Empty Values in Responses
When a value is not set, the API returns it as follows:
A few fields don't follow these rules (they stay as they are, so existing integrations keep working):
Tip: when you check whether a value is empty, treat null and "" the same way.
Response Status Codes
Error Codes
Every error response also has an error_code (a stable code your integration can check instead of reading the message), error_params (the parameters the errors refer to; [] when the API cannot tell) and a request_id. Every response carries the request id in the X-Request-Id header as well: quote it when you contact support. New codes may be added, so handle a code you don't know by its HTTP status.
{"status_code": 400, "status": "Bad Request", "message": "Error retrieving event(s)", "errors": ["Invalid value for the event_id parameter: abc. The event_id parameter must be the numeric id of an event."], "error_code": "invalid_request", "error_params": ["event_id"], "request_id": "3f2c9a7e4b1d4c8e9f0a1b2c3d4e5f60"}
Paging and Changed Records
A list returns every matching record unless you ask for a page. On Retrieve Events, Retrieve Tasks, task comments, miscellaneous expenses/credits, event costs and annual expense costs, pass $limit (the most records to return) and $offset (how many to skip). In the response, records_found is the number of records in it, total_records counts every match and has_more is true while more pages follow; the X-Total-Count header carries the total too. In a URL, write $ as %24.
curl "https://api.exhibitday.com/v1/events?%24limit=100&%24offset=0" -H "api_key: YOUR_API_KEY"
To get only what changed, pass filter_by_last_update_timestamp_greater_than_or_equal_to with the latest last-update timestamp you received (on events, tasks, task comments and miscellaneous expenses/credits). Sync Events and Tasks to Another System shows the whole loop.
Retrying Safely and Conditional Requests
Send an Idempotency-Key header (for example a UUID) with a create (POST). If the call times out and you retry with the same key within 24 hours, you get the first response again (with the header Idempotent-Replayed: true) instead of a second record. Reusing a key for a different request is refused with error_code idempotency_key_reused, and a retry while the first request is still running gets 409 (idempotency_key_in_use). If an earlier request stopped before it finished and its outcome is unknown, a retry gets 409 (idempotency_key_indeterminate) instead of risking a duplicate — check whether that request succeeded, then retry with a new Idempotency-Key.
curl -X POST https://api.exhibitday.com/v1/tasks -H "api_key: YOUR_API_KEY" -H "Idempotency-Key: 5f0c2a8e-7d1b-4c3a-9e6f-2b8d4a1c7e90" -H "Content-Type: application/json" -d "{\"name\":\"Order booth carpet\",\"event_id\":12345}"
Every successful GET response has an ETag header. Send it back in an If-None-Match header: while the data is unchanged, the API answers 304 Not Modified without a body.
Guides
|