Quick Start
Introduction
The idea of this guide is to give you a Hello World moment whereby you'll start using Kana and walk away with everything you need to successfully use our Admin API. We'll get you setup and provide simple example code to create something within Kana.
By the end of this guide, you're going to have:
An API Key
Made a request to our GraphQL API
Created a user
Get your API Key
Our Admin API uses Bearer authentication to validate requests - meaning you'll need an API Key to use as a token within requests.
Where can I get my API Key from?
You can fetch this on the Dashboard via the API page. It's the one listed under Admin API Key.
This should be provided as an Authorization
header within your request - we do not require Bearer
to precede the token. It should look something like this:
Make your first request
For our first request, we're going to create a user through the Admin API. This API is intended for the backend and uses GraphQL.
createUser
POST
https://api.usekana.com/graphql
A standard GraphQL POST request should use the application/json
content type, and include a JSON-encoded body of the following form:
Request Body
Note that the endpoint for our Admin API is always /graphql
, no matter what operation you perform.
Here's an example of what this request would look like in cURL:
Now we can do the following:
Copy the above command and paste it in your CLI/Terminal
Replace
INSERT_API_KEY
with your own Kana API KeyRun the command
When this runs, it should output JSON which looks like this:
This matches the data shape of the query, because GraphQL operations will mirror the order of fields provided within the request in the response - so you'll always know what to expect.
Next Steps
You may now want to know a little more about what you just created within Kana, alongside some of the other concepts that make up the fabric of our product. If you're unfamiliar, then take a look at our Concepts guide:
If you're already in the know, then it's time to dive in deeper by setting up Kana and integrating it within your product. You can either follow our guided walkthrough, or jump straight into our API & SDK documentation:
Last updated