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.
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.Create a user
Creates a User. A standard GraphQL POST request should use the application/json content type, and include a JSON-encoded body of the following form:Body parameters
The query (as a string) detailing the operation, arguments (defined in the variables), and fields to return. See more in the GraphQL guides.Returns the User you created. You can therefore specify
id
, name
and email
as fields to return in the query.The arguments for the request which match the fields and types defined in the query. These need to be be a stringified and escaped JSON object. They can also be hardcoded in the query if you’d prefer (making this optional), but they do need to be provided somewhere. See more in the GraphQL guides.Requires an
input
variable with the fields from CreateUserInput (ie. id
, name
, email
, etc)./graphql
, no matter what operation you perform.
Here’s an example of what this request would look like in cURL:
cURL
- Copy the above command and paste it in your CLI/Terminal
-
Replace
INSERT_API_KEY
with your own Kana API Key - Run the command
Response
Congratulations 🎉You just made a successful call to our GraphQL API and created your first user within Kana!
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:Kana Concepts
Understand a few of the concepts that make up Kana
Guides
How to setup and integrate Kana into your product
Admin API (Backend)
How to use the Admin API