---
title: Use a GraphQL Endpoint
slug: uns/use-a-graphql-endpoint
description: Learn how to use a GraphQL endpoint. 
docTags: 
createdAt: 2024-02-12T15:57:22.413Z
---

Complete the steps below to use a GraphQL endpoint.&#x20;

# Step 1: Create Client

You will first need to log in to your Keycloak profile for Litmus UNS and create a new client.&#x20;

**To create a client:**

1. Access the Keycloak admin console at: `https://<Litmus UNS hostname>/auth/admin`.
2. From the Keycloak Realm drop-down on the left, switch the realm to **standalone**.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/-6AbqaLxgW0gDoTvzd0BU_image.png" size="50" width="346" height="396" position="center" caption="Keycloak realm side menu" showCaption="true"}
3. Navigate to **Clients**.
4. Click **Create client**.&#x20;
5. Configure the *General Settings*.&#x20;
   - **Client type**: Select **OpenID Connect**.&#x20;
   - **Client ID**: Enter a client ID.&#x20;
   - **Name**: Enter a name for the client.&#x20;
   - **Description**: Enter a description for the client.&#x20;
   - **Always display in UI**: Leave the default setting to turn off the setting to always display the client in the user interface.&#x20;
6. Click **Next**.&#x20;
7. Configure the *Capability config* settings.&#x20;
   - **Client authentication**: Click the toggle to enable client authentication.&#x20;
   - **Authorization**: Leave the default setting to turn off authorization.&#x20;
   - **Authentication flow**: Click the checkbox for **Standard flow**, **Direct access grants**, and **Service accounts roles**.&#x20;
8. Click **Next**.&#x20;
9. Leave the *Login settings* empty and click **Save**.&#x20;
   The new client is created.&#x20;

# Step 2: Create API Request

After creating the client in Keycloak, you will then create an API request through GraphQL by using Postman.&#x20;

1. In *Clients*, click the new client name.&#x20;
2. Click the **Credentials&#x20;**&#x74;ab.&#x20;
3. Click the **Copy&#x20;**&#x69;con for the *Client secret*. You will refer to this later.
4. Open the Postman application.&#x20;
5. Open your workspace in the left-navigation menu.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/GK21a6jnSBErr7sMNT6C0_postmanworkspace.png" size="80" width="767" height="453" position="center" caption="Workspace icon" showCaption="true"}
6. Click the **New Request&#x20;**&#x69;con.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Bqn2Mo3SucYIcBF28zgf5_postmannewrequest.png" size="80" width="1118" height="453" position="center" caption="New Request icon" showCaption="true"}
7. Click **New**.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/T2Ga-AuidbXILzbFlMJH5_postmannew.png" size="80" width="1118" height="453" position="center" showCaption="false"}
8. Click **GraphQL**.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/p3Dqw6mAruIakiYnvVz6h_postmangraphqlicon.png" size="80" width="1138" height="840" position="center" showCaption="false"}
9. For the new request, enter the following URL: `https://<Litmus UNS hostname>/mqtt/gql`.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/r4xe8RVI5lxqL6EZ4dmlH_postmanenterurl.png" size="80" width="1138" height="840" position="center" showCaption="false"}
10. Click the **Authorization&#x20;**&#x74;ab.&#x20;
    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/SECqXJrrYTV8mtNy-gSOA_postmanauthorizationtab.png" size="80" width="1084" height="784" position="center" showCaption="false"}
11. For the *Type*, select **OAuth 2.0**.&#x20;
12. Enter the following details for *Configure New Token*.&#x20;
    - **Token Name**: Enter a name for the token.&#x20;
    - **Grant type**: Select **Client Credentials**.&#x20;
    - **Access Token URL**: Enter the following URL: `https://<Litmus UNS hostname>/auth/realms/standalone/protocol/openid-connect/token`
    - **Client secret**: Paste the client secret copied previously.&#x20;
13. Click **Get New Access Token&#x20;**&#x61;nd then **Proceed**.&#x20;
14. From the *Manage Access Tokens* dialog, click **Use Token**.&#x20;
    The token is added to the request.&#x20;

# Step 3: Verify Version and Hash

Once the token added to the API request, you can verify the version and hash values.&#x20;

1. Click the **Schema&#x20;**&#x74;ab.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/CcRvFCpX_09-up8Jrd2m8_postmanschematab.png" size="80" width="1373" height="784" position="center" caption="Schema tab" showCaption="true"}
2. Click **Use GraphQL Introspection**.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/W2gPZkl8g4h1E5vGfizjr_postmanusegraphql.png" size="80" width="1373" height="784" position="center" showCaption="false"}
3. Click the **Query&#x20;**&#x74;ab.&#x20;
4. Click the checkbox for **version**.
   The checkboxes for **version Version!**, **version String!**, and **hash String!&#x20;**&#x73;hould be selected.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/-V-yvvYtHe4sLjHxsj8PV_postmanversioncheckboxes.png" size="80" width="679" height="557" position="center" showCaption="false"}
5. Click **Query**.&#x20;
   The response should display the version and hash values.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/uvNXvpA0oD_xtknvS6II0_image.png" size="80" width="883" height="769" position="center" showCaption="false"}

