Export analytics data
Download the raw actions users performed in your events, as a stream of JSON lines you can load into your own tools.
Before you begin
- An API key created in Swapcard Studio, sent in the
Authorizationheader. See Authentication. - The IDs of the events you want to export.
Send an export request
Send a POST request with the event IDs and a time range. Both time_gt and time_lt are required.
curl -X POST 'https://developer.swapcard.com/event-admin/export/analytics' \
-H 'Content-Type: application/json' \
-H 'Authorization: <TOKEN>' \
-d '{
"event_ids": ["RXZlbnRfMQ==", "RXZlbnRfMg=="],
"time_gt": "2022-09-01T00:00:00.000Z",
"time_lt": "2022-10-01T00:00:00.000Z"
}'
Actions are delayed by 10 minutes: the most recent action returned occurred at least 10 minutes ago.
Request body
Request body
event_idsstring arrayRequiredThe IDs of the events in which the actions occurred.
time_gtstringRequiredRFC 3339 date-time. Only actions that occurred after this timestamp are returned.
time_ltstringRequiredRFC 3339 date-time. Only actions that occurred before this timestamp are returned.
cursorstringStarting position for consecutive calls. Use the cursor of the last row you received.
eventsstring arrayThe action types to return, such as exhibitor_show or meeting_create. See the action type pages for the full list.
group_idsstring arrayOnly return actions triggered by users in these event groups.
user_idsstring arrayOnly return actions triggered by these users.
exhibitor_idsstring arrayOnly return actions triggered by these exhibitors.
limitintegerMaximum number of rows streamed. Default is infinite.
Read the response stream
A successful response is a stream of newline-separated JSON objects, ordered from the least to the most recent. Each line is one action. Without a limit, the stream is potentially infinite, so process it line by line.
{"cursor":"eyJFeGVtcGxlQ3Vyc29yIjogMX0=","time":"2020-09-04T15:00:17.737Z","event":"people_view_search","platform":"web-user","event_id":"RXZlbnRfMQ==","properties":{"query":"market","event_view_id":"RXZlbnRWaWV3XzA="},"user_id":"VXNlcl8w","group_ids":["RXZlbnRHcm91cF8w"]}
{"cursor":"eyJFeGVtcGxlQ3Vyc29yIjogMn0=","time":"2020-09-04T15:00:17.961Z","event":"exhibitor_show","platform":"android","event_id":"RXZlbnRfMQ==","properties":{},"user_id":"VXNlcl8x","group_ids":["RXZlbnRHcm91cF8w","RXZlbnRHcm91cF8x"],"exhibitor_ids":["RXhoaWJpdG9yXzA="],"with_exhibitor_ids":["RXhoaWJpdG9yXzE="]}
Response schema
cursorstringStream row cursor. When you call the endpoint with this cursor, it returns all the rows that come after it.
eventstringAction name. See the action type pages.
created_atstringRFC 3339 date-time when the action occurred.
event_idstringThe event in which the action was triggered.
user_idstringNullableThe user who triggered the action. Null when the user isn't logged in, for example in guest mode.
exhibitor_idsstring arrayNullableThe exhibitors the user belonged to when they triggered the action.
group_idsstring arrayNullableThe groups the user belonged to when they triggered the action.
with_user_idstringNullableOnly for actions performed with another user: the user they interacted with.
with_exhibitor_idsstring arrayNullableOnly for actions performed with another user: the exhibitors that user belonged to when the action was triggered.
with_group_idsstring arrayNullableOnly for actions performed with another user: the groups that user belonged to when the action was triggered.
bodyobjectNullableAction metadata. Its fields depend on the action type; see the action type pages.
Fetch the next actions
To continue an export where you stopped, send the cursor of the last row you processed in your next request. The response starts with the actions that come after that row.
Filter by action type
Pass action names in events to export only those actions. Each action type page lists the action names and the fields of their body:
- Page views: page views, searches, filters and session video streams
- Connections: connections, connection requests and contacts
- Meetings: meeting requests, meetings and participants
- Chat: messages and video calls
- Bookmarks: exhibitor, session and product bookmarks