Start a film
Start a film in a project: a name, and a film document — the project's clips in order, each trimmed and joined to the one before it by a cut or a fade, under one soundtrack: the clips' own sound ke…
curl -X POST https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}'const res = await fetch("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"name" => "Two minutes",
"doc" => [
"v" => 1,
"aspect" => "16:9",
"clips" => [
[
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms" => 0,
"out_ms" => 5000,
"transition" => "cut",
"fade_ms" => 0,
],
[
"item_id" => "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms" => 400,
"out_ms" => 4800,
"transition" => "fade",
"fade_ms" => 500,
],
],
"sound" => [
"clips" => "keep",
"music" => [
"item_id" => "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db" => -12,
"in_ms" => 0,
],
],
],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"name" => "Two minutes",
"doc" => {
"v" => 1,
"aspect" => "16:9",
"clips" => [
{
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms" => 0,
"out_ms" => 5000,
"transition" => "cut",
"fade_ms" => 0
},
{
"item_id" => "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms" => 400,
"out_ms" => 4800,
"transition" => "fade",
"fade_ms" => 500
}
],
"sound" => {
"clips" => "keep",
"music" => {
"item_id" => "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db" => -12,
"in_ms" => 0
}
}
}
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films");
var body = """
{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"id": "<string>",
"project_id": "<string>",
"name": "<string>",
"doc": {
"v": 123,
"aspect": "<string>",
"clips": [
{
"item_id": "<string>",
"in_ms": 123,
"out_ms": 123,
"transition": "<string>",
"fade_ms": 123,
"gain_db": 123,
"mute": true,
"audio_fade_ms": 123,
"audio_lead_ms": 123,
"quiet": [
{
"from_ms": 123,
"to_ms": 123
}
],
"quiet_db": 123
}
],
"sound": {
"clips": "<string>",
"music": "<null or object>"
},
"canvas": {
"width": 123,
"height": 123
},
"fps": 123,
"tracks": [
{
"kind": "<string>",
"gain_db": 123,
"items": [
{
"item_id": "<string>",
"at_ms": 123,
"in_ms": 123,
"out_ms": 123,
"gain_db": 123,
"fade_in_ms": 123,
"fade_out_ms": 123,
"shot": {},
"loop": true
}
]
}
],
"duck": {
"under": "<string[]>",
"depth_db": 123,
"attack_ms": 123,
"release_ms": 123
},
"loudness": {
"target_lufs": 123
},
"titles": [
{
"text": "<string>",
"subtext": "<string>",
"at_ms": 123,
"ms": 123,
"style": "<string>",
"backdrop": "<string>",
"font": "<string>",
"fade_in_ms": 123,
"fade_out_ms": 123,
"shot": {
"plan_id": "<string>",
"shot": 123
},
"end": true
}
],
"join": true
},
"rev": 123,
"duration_ms": 123,
"sources": [
{
"at": "<string>",
"index": 123,
"item_id": "<string>",
"problem": "<string>"
}
],
"exportable": true,
"latest_export": "<null or object>",
"created_at": "<string>",
"updated_at": "<string>",
"dub_of": "<string>",
"language": "<string>",
"budget_ms": 123,
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}Start a film in a project: a name, and a film document — the project's clips in order, each trimmed and joined to the one before it by a cut or a fade, under one soundtrack: the clips' own sound kept or muted, and one music bed from the project's sounds at a level. An empty film when none is sent. The document is read strictly — anything that does not read is refused film_invalid naming each problem — and every clip must be a video of the project, the music one of its sounds (reference_invalid names the field). A film is at most 100 clips and as long as budget_ms says at its frame and rate — every film answered carries it, the longest at 1920 × 1080 and 24 fps, ten minutes by default — and never more than 30 minutes long; each clip keeps at least 500 ms, and a fade is 200 to 3000 ms and at most half the shorter clip it joins. A project keeps up to 20 films. A film with a mix — narration, dialogue, music and sound-effects tracks laid from the project's sounds, each clip's own sound levelled, the music lowered under the voices, a loudness to make it at — is a version-2 document (FilmDocV2), sent with doc_version=2: at most 4 tracks of 120 sounds each, every one a sound of the project. Needs the edit_items capability in the project. Takes a key holding studio:write — Account offers it unticked — or the desktop's own session key. Spends nothing.
Authorizations
Bearer auray_sk_… — studio:write — Account offers it unticked; the desktop's session key holds it.
Path Parameters
Query Parameters
2 for a film with a mix (FilmDocV2). Without it — or with 1 — the request reads version 1, as before version 2 existed: a version-2 film is left out of a list, a read of one is refused film_invalid, and a version-2 document sent is refused film_invalid. One of 1, 2.doc_version=2, either version.1."16:9", "9:16".Show child attributes
"cut", "fade".Show child attributes
"keep", "mute".in_ms into the sound; one that runs on past the film's end fades out over its last moments, and one that ends sooner simply ends. Null for none.2.film_invalid when the film is started, saved or exported.Show child attributes
Show child attributes
"cut", "fade".quiet_db: stretches of the clip's own file — milliseconds of the file, not of the film, so a trim or a move never takes one off the voice it lowers — each at least 100 ms long and after the one before it, with a short ramp at each edge. With quiet_db, both or neither; an empty list says the clip was listened to and held no voice to lower. A clip muted whole because a voice covers most of it keeps its stretches beside mute. A save that names none of a film's titles, quiet and loop over a film that names one is refused film_invalid — see titles.Show child attributes
quiet lowers the clip's own sound, in whole decibels. 0 lowers nothing and keeps the stretches. -30 to 0.Show child attributes
"narration", "dialogue", "music", "sfx".Show child attributes
in_ms to its end plays, then plays again, each repeat blended into the next over 750 ms (or a quarter of the part, when that is shorter), until the length asked (out_ms − in_ms) is filled — so out_ms may run past the sound's end. A part shorter than 100 ms or longer than 2 minutes plays once. False or left out: it plays once and stops at the sound's end. A save that names none of a film's titles, quiet and loop over a film that names one is refused film_invalid — see titles.Show child attributes
narration, dialogue or both.Show child attributes
-16, -14, -23.film_invalid: send an empty list to take every title away. And a save over a film that names titles, a clip's quiet or a sound's loop must name one of the three — the whole film is read, not each clip or sound — or it is refused film_invalid as from an app that knows none of them: send titles: [] when nothing else of the three is left.Show child attributes
title: large, bold and centred — a film's name, an end card. lower_third: a line low on the left, as a name and its role are set. text: a few centred lines — a date, a place, a sentence between scenes. One of "title", "lower_third", "text"."none", "dim", "black"."sans", "serif".Show child attributes
shot. One of true.joinStudioFilms: its clips are 2 to 6 of the project's films, each whole and as it was made — in_ms 0, out_ms its length, a cut, at 0 dB, unmuted, with no fade, lead or quiet of its own — and it has no tracks, duck or titles of its own, at most 50 minutes in all. It is exported by joining them, never by making a frame again. Left out, a film is a cut. Once a film says it, a save that names none of join, titles, a clip's quiet and an item's loop is refused film_invalid. One of true.language and a version-2 doc. Both or neither. A joined film has no second language of its own, and a second language is never a joined film (film_invalid): its acts' second languages are joined instead.dub_of: the second language, as a short tag (id, en, pt-BR).Created.
"film".FilmDoc) unless the request says doc_version=2; then either version, as the film was saved.1."16:9", "9:16".Show child attributes
"cut", "fade".Show child attributes
"keep", "mute".in_ms into the sound; one that runs on past the film's end fades out over its last moments, and one that ends sooner simply ends. Null for none.2.film_invalid when the film is started, saved or exported.Show child attributes
Show child attributes
"cut", "fade".quiet_db: stretches of the clip's own file — milliseconds of the file, not of the film, so a trim or a move never takes one off the voice it lowers — each at least 100 ms long and after the one before it, with a short ramp at each edge. With quiet_db, both or neither; an empty list says the clip was listened to and held no voice to lower. A clip muted whole because a voice covers most of it keeps its stretches beside mute. A save that names none of a film's titles, quiet and loop over a film that names one is refused film_invalid — see titles.Show child attributes
quiet lowers the clip's own sound, in whole decibels. 0 lowers nothing and keeps the stretches. -30 to 0.Show child attributes
"narration", "dialogue", "music", "sfx".Show child attributes
in_ms to its end plays, then plays again, each repeat blended into the next over 750 ms (or a quarter of the part, when that is shorter), until the length asked (out_ms − in_ms) is filled — so out_ms may run past the sound's end. A part shorter than 100 ms or longer than 2 minutes plays once. False or left out: it plays once and stops at the sound's end. A save that names none of a film's titles, quiet and loop over a film that names one is refused film_invalid — see titles.Show child attributes
narration, dialogue or both.Show child attributes
-16, -14, -23.film_invalid: send an empty list to take every title away. And a save over a film that names titles, a clip's quiet or a sound's loop must name one of the three — the whole film is read, not each clip or sound — or it is refused film_invalid as from an app that knows none of them: send titles: [] when nothing else of the three is left.Show child attributes
title: large, bold and centred — a film's name, an end card. lower_third: a line low on the left, as a name and its role are set. text: a few centred lines — a date, a place, a sentence between scenes. One of "title", "lower_third", "text"."none", "dim", "black"."sans", "serif".Show child attributes
shot. One of true.joinStudioFilms: its clips are 2 to 6 of the project's films, each whole and as it was made — in_ms 0, out_ms its length, a cut, at 0 dB, unmuted, with no fade, lead or quiet of its own — and it has no tracks, duck or titles of its own, at most 50 minutes in all. It is exported by joining them, never by making a frame again. Left out, a film is a cut. Once a film says it, a save that names none of join, titles, a clip's quiet and an item's loop is refused film_invalid. One of true.Show child attributes
music for a version-1 film's music too. One of "clip", "narration", "dialogue", "music", "sfx".doc.clips, or the sound's place on its track (the one of kind at in doc.tracks); null for a version-1 film's music. 0 to …. May be null."missing", "trashed", "pending", "withheld", "held", "not_video", "not_audio", "no_file", "too_large".sources stops it.Headers:
| Header | Description |
|---|---|
RateLimit-Limit | Burst capacity. |
RateLimit-Remaining | |
RateLimit-Reset | Seconds until refill. |
X-RateLimit-Limit | |
X-RateLimit-Remaining | |
X-RateLimit-Reset | Unix seconds. The X- spelling is what client libraries read. |
X-Request-Id |
Was this page helpful?
curl -X POST https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}'const res = await fetch("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"name" => "Two minutes",
"doc" => [
"v" => 1,
"aspect" => "16:9",
"clips" => [
[
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms" => 0,
"out_ms" => 5000,
"transition" => "cut",
"fade_ms" => 0,
],
[
"item_id" => "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms" => 400,
"out_ms" => 4800,
"transition" => "fade",
"fade_ms" => 500,
],
],
"sound" => [
"clips" => "keep",
"music" => [
"item_id" => "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db" => -12,
"in_ms" => 0,
],
],
],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"name" => "Two minutes",
"doc" => {
"v" => 1,
"aspect" => "16:9",
"clips" => [
{
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms" => 0,
"out_ms" => 5000,
"transition" => "cut",
"fade_ms" => 0
},
{
"item_id" => "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms" => 400,
"out_ms" => 4800,
"transition" => "fade",
"fade_ms" => 500
}
],
"sound" => {
"clips" => "keep",
"music" => {
"item_id" => "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db" => -12,
"in_ms" => 0
}
}
}
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/films");
var body = """
{
"name": "Two minutes",
"doc": {
"v": 1,
"aspect": "16:9",
"clips": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_ms": 0,
"out_ms": 5000,
"transition": "cut",
"fade_ms": 0
},
{
"item_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"in_ms": 400,
"out_ms": 4800,
"transition": "fade",
"fade_ms": 500
}
],
"sound": {
"clips": "keep",
"music": {
"item_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"gain_db": -12,
"in_ms": 0
}
}
}
}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"id": "<string>",
"project_id": "<string>",
"name": "<string>",
"doc": {
"v": 123,
"aspect": "<string>",
"clips": [
{
"item_id": "<string>",
"in_ms": 123,
"out_ms": 123,
"transition": "<string>",
"fade_ms": 123,
"gain_db": 123,
"mute": true,
"audio_fade_ms": 123,
"audio_lead_ms": 123,
"quiet": [
{
"from_ms": 123,
"to_ms": 123
}
],
"quiet_db": 123
}
],
"sound": {
"clips": "<string>",
"music": "<null or object>"
},
"canvas": {
"width": 123,
"height": 123
},
"fps": 123,
"tracks": [
{
"kind": "<string>",
"gain_db": 123,
"items": [
{
"item_id": "<string>",
"at_ms": 123,
"in_ms": 123,
"out_ms": 123,
"gain_db": 123,
"fade_in_ms": 123,
"fade_out_ms": 123,
"shot": {},
"loop": true
}
]
}
],
"duck": {
"under": "<string[]>",
"depth_db": 123,
"attack_ms": 123,
"release_ms": 123
},
"loudness": {
"target_lufs": 123
},
"titles": [
{
"text": "<string>",
"subtext": "<string>",
"at_ms": 123,
"ms": 123,
"style": "<string>",
"backdrop": "<string>",
"font": "<string>",
"fade_in_ms": 123,
"fade_out_ms": 123,
"shot": {
"plan_id": "<string>",
"shot": 123
},
"end": true
}
],
"join": true
},
"rev": 123,
"duration_ms": 123,
"sources": [
{
"at": "<string>",
"index": 123,
"item_id": "<string>",
"problem": "<string>"
}
],
"exportable": true,
"latest_export": "<null or object>",
"created_at": "<string>",
"updated_at": "<string>",
"dub_of": "<string>",
"language": "<string>",
"budget_ms": 123,
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}