BaseCMS GraphQL API
Documentation Home
  • Getting Started
  • Connecting to the API
  • Modifying Data
    • Introduction
    • Creating a redirect
    • Creating content
    • Modifying content
    • Scheduling content
  • Querying Data
    • Introduction
    • Retrieving a Company
    • Retrieving multiple Companies
    • Retrieving published content
Powered by GitBook
On this page
  • Overview
  • Authenticating to the API
  • Specifying your BASE instance

Connecting to the API

How to use the GraphQL Playground client to connect to the BaseCMS GraphQL API.

PreviousGetting StartedNextIntroduction

Last updated 3 years ago

Overview

For a high-level overview of GraphQL and connection information, review the section.

In this guide, we'll be using the client. You can feel free to use any API client but we think the GraphQL Playground has the best native autocompletion and schema visibility. Other commonly used clients are , , or .

You'll need the following information to query the API:

  • An API URL

  • A Tenant Key

If you're missing any of this information, please reach out to and we'd be happy to provide it!

To get started, open the GraphQL Playground client and select New Workspace. Select the option to use a URL endpoint, and input your API URL:

Once you click open, your workspace will open up. Before you can make any queries against the API, you need to identify your tenant. To do so, add the x-tenant-key header to your client's configuration. In the GraphQL Playground, you can add that to the "HTTP Headers" tab:

Now that you've configured your API client, you can use a feature of GraphQL called introspection. Introspection allows you to browse the schema from your client, without access to the underlying codebase. To browse the schema, you can use the "Schema" (Raw output) or "Docs" (searchable, with comments) tabs on the right side of the screen.

Authenticating to the API

In order to modify data via the GraphQL API, you must be authenticated with a valid user token. To obtain this token, send a request to the login mutation, supplying your BASE username and password.

The returned token should be presented via the Authentication header with a Bearer prefix.

Specifying your BASE instance

In order to use certain mutations that modify data, you will need to specify your BASE instance URL. You can do so by including the URL in the x-base4-api-uri HTTP header.

For a high-level overview of the authentication process, review the guide.

Modifying data: Introduction
Getting Started
GraphQL Playground
Insomnia
Altair
Postman
support@parameter1.com
Creating a new workspace in the GraphQL Playground client
Setting the tenant key header and a basic "ping" query.
The `login` mutation response after supplying a username and password.
The `activeUser` query when supplied a valid authentication token.
Including the BASE instance URI header in GraphQL Playground.