Get started

Get started with the Prepr GraphQL API

This guide explains how to get started with receiving data from the Prepr GraphQL API.

Step 1: Sign up for a Prepr account

Go to signup.prepr.io (opens in a new tab), answer a few questions, and you can start exploring Prepr. You will create a project with a default environment during the onboarding process. Choose to use demo data to help you get going.

Step 2: Get your API URL

Once you’ve signed up for a Prepr account, you can get the API endpoint URL and access token.

By default, there are two API endpoints per environment – Preview and Published. Each API URL has a unique access token with the relevant permission scope.

You can find the API URLs under Settings → Access tokens.

Step 3: Send your first API request

To try out the API endpoint, you can send a basic request with the API Explorer, an interface where you can test your API requests before integrating them into production.

Let’s retrieve all published content items available in the demo data by calling the GraphQL Published API URL.

Navigate to Settings → Access tokens, click to open the GraphQL Published access token details. Under the API URL field, click Open in API Explorer.

Published access token

You’ll be redirected to the API Explorer interface. The GraphQL Published API URL will be registered in the API Explorer automatically.

API Explorer

Copy and paste the following query to the Operation pane and click Run.

Once your request is processed, check out the response. You will get a list of all published articles with their identifiers and titles.

query {
Posts {
 items {
   _id
   title
   }
  }
}

That’s it. You’ve made your first call to the Prepr GraphQL API.

What's next?

You can try out your GraphQL queries using the Apollo Explorer tool.

To learn more about the Prepr GraphQL API, check out the following resources:

If you’re new to GraphQL, see How to GraphQL (opens in a new tab).

Was this article helpful?

We’d love to learn from your feedback