# Management API Authorization

All requests to the server need to be authorized with the management API key. A management API key is sent as an authorization header value.

Each request from the client needs to have the following header:

* `Authorization`, with the following value: `Api-Key _here_is_the_management_api_key_`

#### Example:

Management API key for this example is `h8ZTleS1.OyCHhCST5c8K9A6gjV9wA1HLxWpUVSFv`.

Header:

* `Authorization: Api-Key h8ZTleS1.OyCHhCST5c8K9A6gjV9wA1HLxWpUVSFv`

Full sample code for getting a license key with management API key:

```python
import requests

API_URL = 'https://saas.licensespring.com'

# Can be found in `Settings` -> `Settings` -> `Keys`
API_KEY = '_your_management_api_key_goes_here_'

# Send request
product_short_code = '_your_product_short_code_goes_here_'
quantity = 1 # Replace with desired quantity

response = requests.get(
    url='{}{}'.format(API_URL, '/api/v1/orders/generate_license/'),
    params={'product': product_short_code, 'quantity': quantity},
    headers={
        'Authorization': 'Api-Key {}'.format(API_KEY)
    }
)

print(response.json())
```


---

# 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.licensespring.com/management-api/management-api-authorization.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.
