This repository was archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Video Upload API
John (he/him) edited this page Jul 24, 2024
·
3 revisions
This API endpoint is designed to handle video file uploads. It supports POST requests for uploading video files along with metadata.
- POST
This endpoint requires authorization. You must provide a valid authentication token or an API key. You must include an Authorization header in your request with the Bearer authorization scheme.
To create an API Key, follow the instructions here, with the perquisite of creating an Augmend account here.
Authorization: Bearer YWxhZGRpbjpvcGVuc2VzYW1l
The request body must be a JSON object containing the following fields:
-
name(optional): The name of the video. If not provided, a unique ID will be generated and used as the name. -
downloadUrl(required): The URL from which the video can be downloaded, this must be publicly accessible. -
callbackUrl(required): A URL to which a callback will be sent after the video upload process is completed, this must be publicly accessible. Callback's requests POST body looks like this.
{
"name": "My Video",
"downloadUrl": "https://example.com/video.mp4",
"callbackUrl": "https://yourdomain.com/callback"
}type Response = {
status: 'OK' | 'ERROR';
error?: string;
workspaceId?: string;
}- Code: 200 OK
-
Content: A JSON object containing the status of the operation and workspaceId created from the video:
{ "status": "OK", "workspaceId": "1234" }
- Code: Non-200 HTTP status code
-
Content: A JSON object containing the error details:
{ "status": "ERROR", "error": "Failed to download video" }
Once the video has finished processing and your recording is ready, the Augmend platform will POST a HTTP request to the provided callback. This will be in the body of the request.
type Chapter = {
// Chapter title
title: string,
// POSIX timestamp of the chapter start time.
start: string,
// POSIX timestamp of the chapter's end time.
end: string,
};
type CallbackBody = {
// Unique identifier of the recording (workspace).
wid: string,
// Title of recording.
title: string,
// The video is segmented into chapters, like a book.
chapters: Chapter[]
// Markdown document, a guided instruction rendition of the video content.
steps: string,
// Markdown document, a progress report rendition of the video's content.
status_update: string,
// A summary of the video's content.
synopsis: string,
};curl -X POST https://augumend.com/api/v0/upload-video-file \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My Video", "downloadUrl": "https://example.com/video.mp4", "callbackUrl": "https://yourdomain.com/callback"}'