Session Manager API Examples
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 reference.
Step-by-Step Guide with Example for pallycon-apidata (Session URL API)
Section titled “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 |
| Java | https://github.com/inka-pallycon/pallycon-wm-api-request-sample-java |
Step 1 - Prepare API Request Data JSON
Section titled “Step 1 - Prepare API Request Data JSON”Example JSON for the API data
Section titled “Example JSON for the API data”{ "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
Section titled “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
Section titled “Result of step 2”ra2Q7t5DTIImHYsOcARkiG5/cuXfa/nB4jR3IVBRUVDZBxvqK+zQXcTv2bljMGAyt03WDXbMex5KzrSTIrDbWuDkX0juIMdngoHaS8WKX6fhDlKJ/AkBaUEcF5SkAOmfYgCs7cURH3gwgZ1rrJ6WyBD09vLoqHqAs61a5Mrqv342TYqooCjibcsSYQujXkzfAgLTD390Eiakf/MkWMVVSjw0GP3LZkbnl67SiVwo58aW6ZTz/jnlKCuoz/zicUEa58KLmPzDBJjP8i+VhdRw8Q==Step 3 - Generate hash
Section titled “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
Section titled “Combined string before hash”A3DfypNw0bLgR3FAa5Q2TbS1iiUK4iIfEXPLN5CNHHCgEPVDFBpgtHzraqNUzBZoy4pzx3fSDnzHDMek5AMlmWSlII67tNQ2MJP1NL+dSjQZlEnXp7+ATXOopJEdH1KIZ0jNjY19bRLl9aG0gJSsbS6krhNxuuDzLayT/CgPwQUge1hQj1U2xtXSbDFUfiXSFZtJLSlA/QdTwTC5NpxfLjBmtRspPh1AOuKNwgiS9HuJxV9f6NDK22unYrzZyq6HG+qNEY6O3kp8GdRkdTU62U4t9J/byiAtEkLT2021-09-07T02:15:00ZResult of step 3
Section titled “Result of step 3”- sha256 + base64 output - where to test: https://hash.online-convert.com/sha256-generator
Z4f4gAJPeJUytea8f4DXg7jz+vAkmzNVQEiaU7QO3tA=Step 4 - Build request data JSON and base64 encode
Section titled “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
Section titled “JSON data”{ "data": "N5CNHHCgEPVDFBpgtHzraqNUzBZoy4pzx3fSDnzHDMek5AMlmWSlII67tNQ2MJP1NL+dSjQZlEnXp7+ATXOopJEdH1KIZ0jNjY19bRLl9aG0gJSsbS6krhNxuuDzLayT/CgPwQUge1hQj1U2xtXSbDFUfiXSFZtJLSlA/QdTwTC5NpxfLjBmtRspPh1AOuKNwgiS9HuJxV9f6NDK22unYrzZyq6HG+qNEY6O3kp8GdRkdTU62U4t9J/byiAtEkLT", "timestamp":"2021-09-07T02:15:00Z", "hash":"Z4f4gAJPeJUytea8f4DXg7jz+vAkmzNVQEiaU7QO3tA="}Result of step 4 (base64 encoded JSON)
Section titled “Result of step 4 (base64 encoded JSON)”ewogICAgImRhdGEiOiAiTjVDTkhIQ2dFUFZERkJwZ3RIenJhcU5VekJab3k0cHp4M2ZTRG56SERNZWs1QU1sbVdTbElJNjd0TlEyTUpQMU5MK2RTalFabEVuWHA3K0FUWE9vcEpFZEgxS0laMGpOalkxOWJSTGw5YUcwZ0pTc2JTNmtyaE54dXVEekxheVQvQ2dQd1FVZ2UxaFFqMVUyeHRYU2JERlVmaVhTRlp0SkxTbEEvUWRUd1RDNU5weGZMakJtdFJzcFBoMUFPdUtOd2dpUzlIdUp4VjlmNk5ESzIydW5ZcnpaeXE2SEcrcU5FWTZPM2twOEdkUmtkVFU2MlU0dDlKL2J5aUF0RWtMVCIsCiAgICAidGltZXN0YW1wIjoiMjAyMS0wOS0wN1QwMjoxNTowMFoiLAogICAgImhhc2giOiJaNGY0Z0FKUGVKVXl0ZWE4ZjREWGc3anordkFrbXpOVlFFaWFVN1FPM3RBPSIKfQ==Step 5 - Call Doverunner API URL with the data
Section titled “Step 5 - Call Doverunner API URL with the data”- API URL: https://fwm-session.doverunner.com/api/v2/session/watermarkUrl/EXPL (
EXPLshould be replaced with your site ID) - query param key: pallycon-apidata
- param value: the result of step 4
Combined API URL
Section titled “Combined API URL”https://fwm-session.doverunner.com/api/v2/session/watermarkUrl/EXPL?pallycon-apidata=ewogICAgImRhdGEiOiAiTjVDTkhIQ2dFUFZERkJwZ3RIenJhcU5VekJab3k0cHp4M2ZTRG56SERNZWs1QU1sbVdTbElJNjd0TlEyTUpQMU5MK2RTalFabEVuWHA3K0FUWE9vcEpFZEgxS0laMGpOalkxOWJSTGw5YUcwZ0pTc2JTNmtyaE54dXVEekxheVQvQ2dQd1FVZ2UxaFFqMVUyeHRYU2JERlVmaVhTRlp0SkxTbEEvUWRUd1RDNU5weGZMakJtdFJzcFBoMUFPdUtOd2dpUzlIdUp4VjlmNk5ESzIydW5ZcnpaeXE2SEcrcU5FWTZPM2twOEdkUmtkVFU2MlU0dDlKL2J5aUF0RWtMVCIsCiAgICAidGltZXN0YW1wIjoiMjAyMS0wOS0wN1QwMjoxNTowMFoiLAogICAgImhhc2giOiJaNGY0Z0FKUGVKVXl0ZWE4ZjREWGc3anordkFrbXpOVlFFaWFVN1FPM3RBPSIKfQ==Response from API server (Final result)
Section titled “Response from API server (Final result)”{ "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
Section titled “Example for JWT”This is a Postman Collection that allows you to call APIs using JWT. Please refer to Postman Collection Guide for more details.
Collection JSON file Environment JSON file