# Seamless authorization (only for a standalone solution)

Authorize a client as follows:

1. Get the **Secret Key** and **Redirect URL** in the B2COPY Back Office. To do this:

* Go to **System** > **Settings** in the B2COPY Back Office.
* Navigate to the **Side Auth** section and copy values of the **Secret Key** and **Redirect URL** fields.

{% hint style="info" %}
If the **Secret Key** field is empty, enter a value in the field and save it.\
Please note that editing other fields on the **Settings** page and saving changes may reset the **Secret Key** field to empty. If this occurs, enter a value into the field again.
{% endhint %}

<figure><img src="/files/HWyppDc2vPPJnMhOEiWD" alt="Side Auth section in System > Settings"><figcaption><p>Side Auth section in System > Settings</p></figcaption></figure>

2. Use the following method to obtain the URL of the B2COPY Web UI to which a client from a third-party CRM must be redirected. The URL includes the token for client authorization in the B2COPY Web UI.

<mark style="color:blue;">`POST`</mark> `[host]/api/v1/standalone/auth/getAuthUrl`

## **Request**

**Body**

<table><thead><tr><th>Name</th><th width="99">Type</th><th width="90">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>account_id</code></td><td>string</td><td>Yes</td><td>The MT login (number) of a client account.</td></tr><tr><td><code>secrete_key</code></td><td>string</td><td>Yes</td><td>The secrete key copied from the B2COPY Back Office.</td></tr><tr><td><code>investment_platform_id</code></td><td>string</td><td>Yes</td><td><p>The identifier of the investment platform instance.</p><ul><li>If only one MT server is connected to your B2COPY investment platform, specify 1.</li><li>If you have more than one MT server connected to your B2COPY investment platform, contact the Support team for assistance.</li></ul></td></tr></tbody></table>

**Request example**

```sh
curl --location --request POST 'https://host.name/api/v1/standalone/auth/getAuthUrl' \
--data-raw '{
  "account_id": "77632289",
  "secret_key": "Password1234!",
  "investment_platform_id": "1"
}'
```

## **Response**

The response includes the URL for redirecting the client to the B2COPY Web UI, with the included token for seamless client authorization. The URL format must be as follows: `https://{domain_name}/{token}`.

**Response example**

```sh
{
  "status": 200,
  "meta": {
      "behaviours": [],
      "status": 200
  },
  "data": {
      "url": "https://my4.b2copy-demo.com/f5f9470def7b9b9b96b2427a6ebbd8c2"
  },
  "modules": []
}
```


---

# 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.b2copy.b2broker.com/api-documentation/seamless-authorization-only-for-a-standalone-solution.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.
