Assets are the core resource in Panjaya Dubbing Studio. An asset represents a source video you want to dub into different languages. Each asset can be dubbed into multiple languages, and every language is assigned a unique dubbing ID. You can optionally add SRT files for better accuracy.
Panjaya Dubbing Studio API
To authenticate with the API, you will need to provide your API key in the Authorization header of each request.
It should look like this:
Authorization: Bearer panjaya-{YOUR_API_KEY}Below is a list of supported languages and their corresponding locale codes that are used in Panjaya Dubbing Studio API. Please note that some languages are marked as source languages only, meaning they can only be used as the source language of the uploaded videos, while some are marked as target languages only - meaning they can only be translated into.
| Language | Locale code | Source supported | Target supported |
|---|---|---|---|
| Arabic | ar-AE | ✅ | ✅ |
| Bulgarian | bg-BG | ✅ | ✅ |
| Chinese | zh-CN | ✅ | ✅ |
| Croatian | hr-HR | ✅ | ✅ |
| Czech | cs-CZ | ✅ | ✅ |
| Danish | da-DK | ✅ | ✅ |
| Dutch | nl-NL | ✅ | ✅ |
| English | en-US | ✅ | ✅ |
| Filipino | fil-PH | ✅ | ✅ |
| Finnish | fi-FI | ✅ | ✅ |
| French | fr-FR | ✅ | ✅ |
| German | de-DE | ✅ | ✅ |
| Greek | el-GR | ✅ | ✅ |
| Hebrew | he-IL | ✅ | 🚫 |
| Hindi | hi-IN | ✅ | ✅ |
| Hungarian | hu-HU | ✅ | ✅ |
| Indonesian | id-ID | ✅ | ✅ |
| Italian | it-IT | ✅ | ✅ |
| Japanese | ja-JP | ✅ | ✅ |
| Korean | ko-KR | ✅ | ✅ |
| Lithuanian | lt-LT | ✅ | ✅ |
| Malay | ms-MY | ✅ | ✅ |
| Norwegian | nb-NO | ✅ | ✅ |
| Polish | pl-PL | ✅ | ✅ |
| Portuguese | pt-BR | ✅ | ✅ |
| Portuguese | pt-PT | ✅ | ✅ |
| Romanian | ro-RO | ✅ | ✅ |
| Russian | ru-RU | ✅ | ✅ |
| Slovak | sk-SK | ✅ | ✅ |
| Spanish | es-ES | ✅ | ✅ |
| Spanish | es-MX | ✅ | ✅ |
| Swedish | sv-SE | ✅ | ✅ |
| Tamil | ta-IN | ✅ | ✅ |
| Turkish | tr-TR | ✅ | ✅ |
| Ukrainian | uk-UA | ✅ | ✅ |
| Vietnamese | vi-VN | ✅ | ✅ |
Panjaya Dubbing Studio API uses standard HTTP status codes to indicate the success or failure of an API request. In case of an error, the response body will include a detailed error message to help you identify and resolve the issue.
Here is a list of erroneous HTTP status codes and their general meanings:
- 401 Unauthorized: The API key could not be validated
- 400 Bad Request: The request could not be processed due to invalid input
- 403 Forbidden: The request could not be completed due to account limitations
- 404 Not Found: The requested resource was not found
- 500 Internal Server Error: An internal server error occurred
https://api.panjaya.ai/
Request
To stay informed about the progress of dubbing processes, you can configure a callback URL.
For every status update related to an asset or its versions, Panjaya will send an HTTP POST request to the specified URL.
Each update includes the following details:
- Asset ID: The unique identifier for the asset. This field is always included.
- Version ID: The unique identifier for the version. This field is optional and is included only for version-related events.
- Version locale: The target language of the version. This field is optional and is included only for version-related events.
- Event type specifies the type of event that occurred. Possible values are:
asset_failed: An error occurred while processing the asset. In this case,version_idfield will benull.version_ready: The version is ready for QC and additional editing in the workspaceversion_failedAn error occurred during the dubbing process for this version.version_generatingThe version final video generation process has started.version_generated: The version has been successfully generated. A URL to download the final video will be provided in theresult_urlfield in Get Version endpoint.version_generate_failed: An error occurred during the video generation process.
To ensure the authenticity of our callback requests, each request will include a signature in the X-Signature header.
The signature is calculated on the raw HTTP request's body, using the ES256 algorithm.
Optionally, you may use the X-Signature header to verify the authenticity of our request in your server.
Below is Panjaya's public key, to be used for verifying our callback's content:
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZbUzbbuVyzSv7zVmH6rKypr6ojSS
/86W9dU6mwbdfAtUAx+QI7GNxl/4H1QV2BuBrysabh56O/YXhnFJMh7Lng==
-----END PUBLIC KEY-----And here's an example of how to verify the signature in Python:
import binascii
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.exceptions import InvalidSignature
PANJAYA_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZbUzbbuVyzSv7zVmH6rKypr6ojSS\n/86W9dU6mwbdfAtUAx+QI7GNxl/4H1QV2BuBrysabh56O/YXhnFJMh7Lng==\n-----END PUBLIC KEY-----'
public_key = serialization.load_pem_public_key(PANJAYA_PUBLIC_KEY.encode())
def validate_panjaya_signature(request: Request) -> bool:
raw_body = request.body()
signature = request.headers.get("X-Signature")
try:
signature_bytes = binascii.unhexlify(signature)
public_key.verify(signature_bytes, raw_body, ec.ECDSA(hashes.SHA256()))
print("Signature is valid ✅")
return True
except InvalidSignature:
print("Signature is invalid ❌")
return FalseHere's an example of the payload you can expect:
https://api.panjaya.ai/callback
{ "event": "version_generated", "asset_id": "7b9b9e3c3c7e322aec4c3d9b", "version_id": "7b9b9e3c3c7e322aec4c3d9d" }