TypeScript SDK
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const video = await client.videos.retrieve("video_request_id");
console.log(video.status, video.result?.video_url);import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
video = client.videos.retrieve("video_request_id")
print(video["status"], video.get("result", {}).get("video_url"))curl --request GET \
--url https://www.ninjachat.ai/api/v1/videos/{id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "video",
"status": "queued",
"progress": 50,
"video_url": "<string>",
"error": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Media & search
Get a video job
Poll job status until completed or failed. Prefer a webhook if you do not want to poll.
GET
/
videos
/
{id}
TypeScript SDK
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const video = await client.videos.retrieve("video_request_id");
console.log(video.status, video.result?.video_url);import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
video = client.videos.retrieve("video_request_id")
print(video["status"], video.get("result", {}).get("video_url"))curl --request GET \
--url https://www.ninjachat.ai/api/v1/videos/{id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "video",
"status": "queued",
"progress": 50,
"video_url": "<string>",
"error": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Use an API key created in the NinjaChat developer console.