# User

## Overview

The user info provides information about the user's public profile in Elixir. This endpoint can validate the Elixir JWT as an OpenID system. Besides, the game can get the wallets of the user in case they are needed.<br>

## Userinfo/Open ID

<mark style="color:blue;">`GET`</mark> `https://kend.elixir.app/sdk/v2/userinfo`

Method to provide all Elixir User-related info. Works as an OpenId to validate the user JWT.

#### Headers

| Name                                            | Type   | Description                                             |
| ----------------------------------------------- | ------ | ------------------------------------------------------- |
| x-api-key<mark style="color:red;">\*</mark>     | String | Public Key available on the Developer Dashboard         |
| authorization<mark style="color:red;">\*</mark> | String | A string containing the JWT as follows: "Bearer \<jwt>" |

{% tabs %}
{% tab title="200: OK Success Response" %}

```javascript
{
    "code": 1,
    "success": true,
    "data": {
        "sub": "aea...36",
        "wallets": [
            "BINANCE:0xB...8",
            "SOLANA:Eb...1w"
        ],
        "nickname": "rega",
        "picture": "https://...",
        "status": "ACTIVE",
        "email": "user@email.com",
        "email_verified": true,
        "aud": "game:production",
        "iss": "gameId",
        "iat": 1675127300,
        "exp": 1675386500
    }
}

```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": -1,
    "success": false,
    "error": {
        "status": 400,
        "code": 1001,
        "message": "The argument 'encoding' is invalid for data of length 1151. Received 'hex'"
    }
}
```

{% endtab %}
{% endtabs %}

## User Friend List

<mark style="color:blue;">`GET`</mark> `https://kend.elixir.app/sdk/v2/friends/`

Get the Friend List for a given user. Friend information is provided so it can be displayed with avatars. Each friend `ElixirId` is available on the `friendId` field

#### Headers

| Name                                            | Type   | Description                                             |
| ----------------------------------------------- | ------ | ------------------------------------------------------- |
| x-api-key<mark style="color:red;">\*</mark>     | String | Public Key available on the Developer Dashboard         |
| authorization<mark style="color:red;">\*</mark> | String | A string containing the JWT as follows: "Bearer \<jwt>" |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "code": 1,
    "success": true,
    "data": [
        {
            "friendId": "9ce7916c-de8e-44c8-b4aa-455385c601a6",
            "username": "sniper-4015",
            "name": "Sniper",
            "avatar": "https://d1udajbuf50cfc.cloudfront.net/avatar/9ce7916c-de8e-44c8-b4aa-455385c601a6/1675145810918_screenshot_2023_01_18_at_14_52_08_png",
            "isVerifiedNFTAvatar": false,
            "friendStatus": "ACCEPTED",
            "status": "OFFLINE",
            "playStatus": {
                "playing": false
            }
        },
        {
            "friendId": "a2a1f018-c836-4041-bd2d-95a7c4734d36",
            "username": "gunner-8634",
            "name": "Gunner",
            "avatar": "https://d1udajbuf50cfc.cloudfront.net/avatar/aea1f008-c8a6-4041-bd2d-95a7c4735d36/greenie.gif",
            "isVerifiedNFTAvatar": true,
            "friendStatus": "ACCEPTED",
            "status": "OFFLINE",
            "playStatus": {
                "playing": false
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.elixir.app/api-docs/api-docs-1/user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
