Skip to main content
View as Markdown

Quickstart

Make your first request to the Content API: create an API key, list your events, then fetch one.

Before you start

You need access to an organization in Swapcard Studio. Building for an exhibitor instead? Start with the Leads API.

1. Create an API key​

In Studio, open your profile menu and go to API keys, then select Create a new key.

The key acts on behalf of your user, with your roles and permissions. Keep it on your server and never ship it in a web page or mobile app. See Authentication for details.

2. List your events​

Every request is a POST to a single GraphQL endpoint. Send your key as-is in the Authorization header.

curl https://developer.swapcard.com/event-admin/graphql \
-H 'Authorization: <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{"query": "{ events(pageSize: 10) { id title beginsAt } }"}'

Copy the id of the event you want to work with.

3. Fetch one event​

Pass the ID as a variable. GraphQL returns exactly the fields you ask for.

query EventById($eventId: ID!) {
event(id: $eventId) {
title
beginsAt
endsAt
timezone
totalExhibitors
totalSpeakers
}
}
Variables
{ "eventId": "<EVENT_ID>" }
Prefer clicking to typing?

The API Explorer runs the same queries in your browser, with autocomplete for every field.

Next steps​