# Request Signing

To ensure the integrity and authenticity of requests, certain API keys require requests to be signed using HMAC-SHA256.

Signature parameters should be used when passing sensitive information. If the following URL parameters are present in the URL:

`withdraw_address`

## Request Structure

### Option 1: Header-based (recommended)

{% code overflow="wrap" %}

```http
GET https://flow.onside.io?withdraw_address={withdraw_address}
X-Api-Key: your_api_key
X-Signature: your_signature
```

{% endcode %}

### Option 2: Query-based

{% code overflow="wrap" %}

```
GET https://flow.onside.io?api_key={your_api_key}&withdraw_address={withdraw_address}&signature={your_signature}
```

{% endcode %}

## Signature generation

{% code overflow="wrap" %}

```javascript
const crypto = require("crypto");

const withdrawalAddress = "your_withdraw_address";
const secretKey = "your_secret_key"; // Provided securely by Onside

const stringToSign = `withdraw_address=${withdrawalAddress}`;
const signature = crypto
  .createHmac("sha256", secretKey)
  .update(stringToSign)
  .digest("hex");
```

{% endcode %}

## Secret key

To enable request signing and receive your secret key, please contact your account manager at Onside Flow.


---

# 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.onside.io/onside-flow/request-signing.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.
