Skip to main content

Prerequisites

  • An ION organization.
  • An API key for machine-to-machine integrations, or OAuth credentials for user-facing applications. For how to obtain each, see Authentication.
  • A tool that can make HTTPS POST requests with JSON bodies, such as curl, httpie, or Postman.
  • Familiarity with GraphQL.
New to GraphQL? See the official GraphQL documentation.

The endpoint

Your API endpoint depends on the region your organization runs in. Send every request, with POST, to the API endpoint for your environment. For each production and sandbox environment’s endpoint, see ION environments.
The examples in these guides use the US endpoint, api.buildwithion.com. Replace it with your region’s endpoint.
Authenticate each request with these headers:

Get an access token

If you have an API key, exchange it for a short-lived access token through your auth provider’s client-credentials grant. For a reusable pattern, see the Build an API client. If you use OAuth 2.0, complete the authorization code flow in Authenticate with OAuth 2.0. After the user signs in, your callback receives an access_token. Both paths give you a JWT string. Treat it like a password.

Make your first request

A minimal “who am I?” query confirms the token works:
A successful response looks like this:
If the response is an errors payload instead, see Error codes and its 401 table.

Query data

Once auth works, try a domain query that lists parts:
The response contains up to five parts from your org. If the response comes back empty, your org might not have parts yet. Query me again to confirm the token is valid. Then check the admin UI for data.

Pick your next page

Where to go next depends on what you’re building: