> For the complete documentation index, see [llms.txt](https://futuricblock.gitbook.io/futuric-waas-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://futuricblock.gitbook.io/futuric-waas-documentation/integration-documentation/api-authentication.md).

# API Authentication

Futuric-WaaS uses API keys combined with the concept of signing to authorize API callers.

The following example demonstrates how to sign a payload to obtain a signature and access the "Create User" API. In this API, you must pass the values of "ApiKey", "Signature", and "SubGuid" in the Header, as well as the "subUserId" value in the original Body.

### POST: Create Sub User

<http://demo-waas-gateway.futuricblock.com/api/v2/wallet/user/create?api-version=2.0>

| Variable Name | Value Type | Optional | Example                                       |
| ------------- | ---------- | -------- | --------------------------------------------- |
| subUserId     | `string`   | No       | `"SUID-32a0fb0e-bdad-4d68-9734-756bdeb24ca9"` |

**Query Parameters**

| Parameter Name | Value |
| -------------- | ----- |
| api-version    | 2.0   |

**Body (JSON)**

```json
{
    "subUserId": "Test_1234"
}
```

**Example Request**

```
curl --location 'http://demo-waas-gateway.futuricblock.com/api/v2/wallet/user/create?api-version=2.0' \
--header 'ApiKey: 4a88c6f1d6d24e46b2b0edd0ad69bac5f' \
--header 'Signature: [Your_Signature]' \
--header 'SubGuid: SUB_00001' \
--data-raw '{
    "subUserId": "SUID-32a0fb0e-bdad-4d68-9734-756bdeb24ca9"
}'

```

To use RSA digital signatures, you need to convert the entire original body payload string into a Base64 encoded string, as shown below:

**Original**

```
{
    "subUserId": "Test_1234"
}
```

**Base64 Encoded**

```json
eyJzdWIiOiJ2VzVSVWQ0a0lLaVczdzd4dzN4dWlMIn0=
```

Then, you will use the RSA private key to sign the Base64 data to obtain the signature string.

{% hint style="info" %}
You should use the SHA-512 with RSA hashing algorithm, with a signature size of 2048 bits integer, corresponding to the size of the RSA keys
{% endhint %}

You can also generate and verify signatures on the following website:

<https://www.base64encode.org/zh/> <https://8gwifi.org/RSAFunctionality?rsasignverifyfunctions=rsasignverifyfunctions&keysize=2048>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://futuricblock.gitbook.io/futuric-waas-documentation/integration-documentation/api-authentication.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.
