---
title: "Session Manager API Examples"
description: "Step-by-step example of building a pallycon-apidata request for the Session URL API, and a Postman collection for calling the Session Manager APIs with JWT."
---
> For the complete documentation index, see [llms.txt](https://docs.doverunner.com/llms.txt).

This page walks through calling the Session Manager API: building a `pallycon-apidata` request step by step, and calling the APIs with JWT from Postman. The request and response formats, parameters and error codes are specified in the [Session Manager API](https://docs.doverunner.com/content-security/forensic-watermarking/embedding/session-manager/) reference.

## Step-by-Step Guide with Example for pallycon-apidata (Session URL API)

The guide below shows step-by-step how to generate request data and get a response for the `Session URL API`. Other APIs, such as `Session List API`, can be applied in a similar way.

In addition to the below step-by-step example, please also refer to our sample codes uploaded on Github.

|Sample Type |GitHub Link |
|---|---|
|Python| [https://github.com/inka-pallycon/pallycon-wm-api-request-sample-python](https://github.com/inka-pallycon/pallycon-wm-api-request-sample-python) |
|Java| [https://github.com/inka-pallycon/pallycon-wm-api-request-sample-java](https://github.com/inka-pallycon/pallycon-wm-api-request-sample-java) |

:::note 

The input values used in the example are for reference only. For actual operation, you must enter the values corresponding to your DoveRunner account.

:::

### Step 1 - Prepare API Request Data JSON

#### Example JSON for the API data

```json
{
    "domain": "cdn.service-site.com",
    "output_path": "output",
    "cid": "content1",
    "streaming_format": "dash",
    "forensic_mark": "testmark.1234567",
    "wmt_type": "aes", 
    "prefix_folder": "wm-contents"
}
```

### Step 2 - AES256 encryption of the API data

- Where to test : https://www.devglan.com/online-tools/aes-encryption-decryption
- Mode: CBC
- Key size: 256
- IV: 0123456789abcdef
- Secret key: cUk29dLagiJ0FGiK681tFIR75ETESe0S (Input your site key shown on DoveRunner Console)
- Output format: base64 text

#### Result of step 2

```txt
ra2Q7t5DTIImHYsOcARkiG5/cuXfa/nB4jR3IVBRUVDZBxvqK+zQXcTv2bljMGAyt03WDXbMex5KzrSTIrDbWuDkX0juIMdngoHaS8WKX6fhDlKJ/AkBaUEcF5SkAOmfYgCs7cURH3gwgZ1rrJ6WyBD09vLoqHqAs61a5Mrqv342TYqooCjibcsSYQujXkzfAgLTD390Eiakf/MkWMVVSjw0GP3LZkbnl67SiVwo58aW6ZTz/jnlKCuoz/zicUEa58KLmPzDBJjP8i+VhdRw8Q==
```

### Step 3 - Generate hash

- site access key: A3DfypNw0bLgR3FAa5Q2TbS1iiUK4iIf (Input your access key shown on DoveRunner Console)
- site ID: EXPL (Input your site ID shown on DoveRunner Console)
- api data: the result from step 2
- timestamp: 2021-09-07T02:15:00Z

#### Combined string before hash

```txt
A3DfypNw0bLgR3FAa5Q2TbS1iiUK4iIfEXPLN5CNHHCgEPVDFBpgtHzraqNUzBZoy4pzx3fSDnzHDMek5AMlmWSlII67tNQ2MJP1NL+dSjQZlEnXp7+ATXOopJEdH1KIZ0jNjY19bRLl9aG0gJSsbS6krhNxuuDzLayT/CgPwQUge1hQj1U2xtXSbDFUfiXSFZtJLSlA/QdTwTC5NpxfLjBmtRspPh1AOuKNwgiS9HuJxV9f6NDK22unYrzZyq6HG+qNEY6O3kp8GdRkdTU62U4t9J/byiAtEkLT2021-09-07T02:15:00Z
```

#### Result of step 3

- sha256 + base64 output - where to test: https://hash.online-convert.com/sha256-generator

```txt
Z4f4gAJPeJUytea8f4DXg7jz+vAkmzNVQEiaU7QO3tA=
```

### Step 4 - Build request data JSON and base64 encode

- 'data': the result of step 2
- 'timestamp': the same timestamp as in step 3
- 'hash': the result of step 3

#### JSON data

```json
{
    "data": "N5CNHHCgEPVDFBpgtHzraqNUzBZoy4pzx3fSDnzHDMek5AMlmWSlII67tNQ2MJP1NL+dSjQZlEnXp7+ATXOopJEdH1KIZ0jNjY19bRLl9aG0gJSsbS6krhNxuuDzLayT/CgPwQUge1hQj1U2xtXSbDFUfiXSFZtJLSlA/QdTwTC5NpxfLjBmtRspPh1AOuKNwgiS9HuJxV9f6NDK22unYrzZyq6HG+qNEY6O3kp8GdRkdTU62U4t9J/byiAtEkLT",
    "timestamp":"2021-09-07T02:15:00Z",
    "hash":"Z4f4gAJPeJUytea8f4DXg7jz+vAkmzNVQEiaU7QO3tA="
}
```

#### Result of step 4 (base64 encoded JSON)

```txt
ewogICAgImRhdGEiOiAiTjVDTkhIQ2dFUFZERkJwZ3RIenJhcU5VekJab3k0cHp4M2ZTRG56SERNZWs1QU1sbVdTbElJNjd0TlEyTUpQMU5MK2RTalFabEVuWHA3K0FUWE9vcEpFZEgxS0laMGpOalkxOWJSTGw5YUcwZ0pTc2JTNmtyaE54dXVEekxheVQvQ2dQd1FVZ2UxaFFqMVUyeHRYU2JERlVmaVhTRlp0SkxTbEEvUWRUd1RDNU5weGZMakJtdFJzcFBoMUFPdUtOd2dpUzlIdUp4VjlmNk5ESzIydW5ZcnpaeXE2SEcrcU5FWTZPM2twOEdkUmtkVFU2MlU0dDlKL2J5aUF0RWtMVCIsCiAgICAidGltZXN0YW1wIjoiMjAyMS0wOS0wN1QwMjoxNTowMFoiLAogICAgImhhc2giOiJaNGY0Z0FKUGVKVXl0ZWE4ZjREWGc3anordkFrbXpOVlFFaWFVN1FPM3RBPSIKfQ==
```

### Step 5 - Call DoveRunner API URL with the data

- API URL: https://fwm-session.doverunner.com/api/v2/session/watermarkUrl/EXPL (`EXPL` should be replaced with your site ID)
- query param key: pallycon-apidata
- param value: the result of step 4

### Combined API URL

```txt
https://fwm-session.doverunner.com/api/v2/session/watermarkUrl/EXPL?pallycon-apidata=ewogICAgImRhdGEiOiAiTjVDTkhIQ2dFUFZERkJwZ3RIenJhcU5VekJab3k0cHp4M2ZTRG56SERNZWs1QU1sbVdTbElJNjd0TlEyTUpQMU5MK2RTalFabEVuWHA3K0FUWE9vcEpFZEgxS0laMGpOalkxOWJSTGw5YUcwZ0pTc2JTNmtyaE54dXVEekxheVQvQ2dQd1FVZ2UxaFFqMVUyeHRYU2JERlVmaVhTRlp0SkxTbEEvUWRUd1RDNU5weGZMakJtdFJzcFBoMUFPdUtOd2dpUzlIdUp4VjlmNk5ESzIydW5ZcnpaeXE2SEcrcU5FWTZPM2twOEdkUmtkVFU2MlU0dDlKL2J5aUF0RWtMVCIsCiAgICAidGltZXN0YW1wIjoiMjAyMS0wOS0wN1QwMjoxNTowMFoiLAogICAgImhhc2giOiJaNGY0Z0FKUGVKVXl0ZWE4ZjREWGc3anordkFrbXpOVlFFaWFVN1FPM3RBPSIKfQ==
```

### Response from API server (Final result)

```json
{
    "error_message":"Success",
    "error_code":"0000",
    "url":"https://cdn.service-site.com/wm-contents/OHVPUw4N4tUoc-wlcA72aX6Hj5a_v-HuXcLAbFwYSpwDDsiVdSLNbWnbjkVvTX20yiKw7U6nOmJzZaDep1_3YJYxfvHzof01IAVgAguBhGk=/output/ddb2b84b-c3ce-4f37-9182-c36f83fc3fce/dash/stream.mpd"
}
```

## Example for JWT
This is a Postman Collection that allows you to call APIs using JWT. Please refer to [Postman Collection Guide](https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#importing-data-into-postman) for more details.

[Collection JSON file](https://docs.doverunner.com/files/Session-API-Sample-JWT.postman_collection.json)

[Environment JSON file](https://docs.doverunner.com/files/Session-API-Sample-JWT.postman_environment.json)