Skip to main content
View as Markdown

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 Authorization header. 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.

Request
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"
}'
note

Actions are delayed by 10 minutes: the most recent action returned occurred at least 10 minutes ago.

Request body​

Request body

  • event_idsstring arrayRequired

    The IDs of the events in which the actions occurred.

  • time_gtstringRequired

    RFC 3339 date-time. Only actions that occurred after this timestamp are returned.

  • time_ltstringRequired

    RFC 3339 date-time. Only actions that occurred before this timestamp are returned.

  • cursorstring

    Starting position for consecutive calls. Use the cursor of the last row you received.

  • eventsstring array

    The action types to return, such as exhibitor_show or meeting_create. See the action type pages for the full list.

  • group_idsstring array

    Only return actions triggered by users in these event groups.

  • user_idsstring array

    Only return actions triggered by these users.

  • exhibitor_idsstring array

    Only return actions triggered by these exhibitors.

  • limitinteger

    Maximum 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.

Response
{"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

  • cursorstring

    Stream row cursor. When you call the endpoint with this cursor, it returns all the rows that come after it.

  • eventstring

    Action name. See the action type pages.

  • created_atstring

    RFC 3339 date-time when the action occurred.

  • event_idstring

    The event in which the action was triggered.

  • user_idstringNullable

    The user who triggered the action. Null when the user isn't logged in, for example in guest mode.

  • exhibitor_idsstring arrayNullable

    The exhibitors the user belonged to when they triggered the action.

  • group_idsstring arrayNullable

    The groups the user belonged to when they triggered the action.

  • with_user_idstringNullable

    Only for actions performed with another user: the user they interacted with.

  • with_exhibitor_idsstring arrayNullable

    Only for actions performed with another user: the exhibitors that user belonged to when the action was triggered.

  • with_group_idsstring arrayNullable

    Only for actions performed with another user: the groups that user belonged to when the action was triggered.

  • bodyobjectNullable

    Action 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