# How to Generate a Token for using the Qbert API

## Problem

Qbert is the Platform9 Managed Kubernetes(PMK) cluster manager, running in the Management Plane. It enables CRUD (create, read, update, delete) operations on one or more Kubernetes clusters within PMK.

Qbert requires a project scoped token to authorize the calls made to the REST API.

## Environment

* Platform9 Managed Kubernetes - All Versions

## Procedure

1. Run the following command on the machine where you intend to use the Qbert API.

{% tabs %}
{% tab title="Qbert API" %}

```ruby
TOKEN=$(curl -D - -sH "Content-Type: application/json" https://<URL>/keystone/v3/auth/tokens -d '{"auth": {"identity": {"methods": ["password"], "password": {"user": {"name": "<email>", "domain": {"id": "default"}, "password": "<Password>"}}}}}' | grep -Fi 'X-Subject-Token' | awk '{print $2}')
```

{% endtab %}
{% endtabs %}

2. You can now use the Qbert API by passing the saved TOKEN as the Authorization medium.

{% tabs %}
{% tab title="API" %}

```ruby
curl --request GET --url /qbert/v3/{project_uuid}/nodes --header "X-Auth-Token: $TOKEN"
```

{% endtab %}
{% endtabs %}

3. The project\_uuid can be obtained from the UI by clicking on your **Profile** at the top right **-> Admin Settings -> Tenant -> Tenant UUID**

## Additional Information

* These tokens are project scoped, so make sure your user has access to this project/tenant.
* [More information about Qbert](https://github.com/platform9/pcd-docs-gitbook/blob/main/knowledge/articles/360051634514/en-us?brand_id=227678/README.md).
* [Qbert API Reference.](https://platform9.com/docs/qbert-v3/ref#top)
