Skip to main content

API Overview

Let's discover Blocks API.

Using the API

In order to use the API, you would first need a X-Blocks-Key. Some API also require an acess token. We will show you how to acquire each of these.

Get the X-Blocks-Key

You can get the X-Blocks-Key by going to the Environment Overview Page. Hover to the right of the key to reveal a copy button. This key is specific to your project. If you want to access data for another project, you would have to use the key that belongs to that project.

projectkey

Once you have your api key pass it as a header value.

info

Some endpoints require a project key. You can use the X-Blocks-Key as the project key.

Get an access token

To get the token, go to the authentication serivce. In the General tab, enable Client Credential. Head over to the Client Credential Tab and create a new one. Learn more about configuring client credentials here.

Once you have acquired an access token you can pass it as a header.

note

the access token is not needed for endpoints that are public. Please look at the required headers to know which endpoints require the access token.

Call the API

Now that you have configured client credentials and have the x-blocks-key, you are ready to make the api call.

curl --location 'https://api.seliseblocks.com/authentication/v1/OAuth/Token' \
--header 'x-blocks-key: <your-x-blocks-key>' \
--form 'grant_type="client_credential"' \
--form 'client_id="<YOUR_CLIENT_ID>"' \
--form 'client_secret="<YOUR_CLIENT_SECRET>"'

In the reponse you will get the access token. With it, you are ready to use Blocks API!