# 3. Compile Video https://api.shotstack.io/edit/stage/render POST https://graph.facebook.com/edit/stage/render Content-Type: application/json Reference: https://docs.deao.dev/cloudflare/yt-channel-videos-upload-workflow/3-compile-video-https-api-shotstack-io-edit-stage-render ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /edit/stage/render: post: operationId: 3-compile-video-https-api-shotstack-io-edit-stage-render summary: 3. Compile Video https://api.shotstack.io/edit/stage/render tags: - subpackage_ytChannelVideosUploadWorkflow parameters: - name: x-api-key in: header required: false schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: >- #/components/schemas/YT Channel Videos Upload Workflow_3. Compile Video https://api.shotstack.io/edit/stage/render_Response_200 requestBody: content: application/json: schema: type: string servers: - url: https://graph.facebook.com - url: https://www.youtube.com - url: https://youtube-video-summarizer-gpt-ai.p.rapidapi.com - url: https://api.cloudflare.com - url: https://dev-musiccast.odoo.com - url: https://api.search.brave.com - url: https://og-image-generator-dev.deao.workers.dev - url: https://musiccast.odoo.com - url: https://m.musicca.st - url: https://api.stripe.com - url: https://api.kie.ai - url: https://api.pexels.com - url: https://api.shotstack.io - url: https://oauth2.googleapis.com - url: https://www.googleapis.com - url: https://api.linkedin.com - url: https://www.linkedin.com - url: https://rupload.facebook.com - url: https://api.x.com - url: https://open.tiktokapis.com - url: https://open-upload-sg.tiktokapis.com - url: https://social-media-posting-dev.deao.workers.dev components: schemas: YT Channel Videos Upload Workflow_3. Compile Video https://api.shotstack.io/edit/stage/render_Response_200: type: object properties: {} description: Empty response body title: >- YT Channel Videos Upload Workflow_3. Compile Video https://api.shotstack.io/edit/stage/render_Response_200 ``` ## SDK Code Examples ```python import requests url = "https://graph.facebook.com/edit/stage/render" payload = "{ \"callback\": \"https://{{env.worker_name}}deao.workers.dev/step3\", \"timeline\": { \"background\": \"#000000\", \"tracks\": [ { \"clips\": [ //logo { \"length\": \"end\", \"asset\": { \"type\": \"image\", \"src\": \"https://musiccast.odoo.com/web/image/3427\" }, \"start\": \"auto\", \"transition\": { \"in\": \"fadeSlow\", \"out\": \"fadeSlow\" } } ] }, { \"clips\": [ //videos { \"length\": \"auto\", \"asset\": { \"type\": \"video\", //Video 1 \"src\": \"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\", \"volume\": 1 }, \"start\": \"auto\", \"transition\": { \"in\": \"fadeSlow\" //first video } }, { \"length\": \"auto\", \"asset\": { \"type\": \"video\", //Video 2 \"src\": \"https://videos.pexels.com/video-files/....mp4\", \"volume\": 1 }, \"start\": \"auto\" }, { \"length\": \"auto\", \"asset\": { \"type\": \"video\", //video 3 \"src\": \"https://videos.pexels.com/video-files/....mp4\", \"volume\": 1 }, \"start\": \"auto\" }, { \"length\": \"end\", // last video \"asset\": { \"type\": \"video\", // Video 4 \"src\": \"https://videos.pexels.com/video-files/....mp4\", \"volume\": 1 }, \"start\": \"auto\", \"transition\": { \"out\": \"fadeSlow\" //last video } } ] }, { \"clips\": [ //audios { \"length\": \"auto\", \"asset\": { \"type\": \"audio\", // audio 1 \"src\": \"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\", \"volume\": 1 }, \"start\": \"auto\" }, { \"length\": \"end\", // last audio \"asset\": { \"type\": \"audio\", // audio 2 \"src\": \"https://tempfile.aiquickdraw.com/r/....mp3\", \"volume\": 1 }, \"start\": \"auto\" } ] } ] }, \"output\": { \"format\": \"mp4\", \"fps\": 30, \"size\": { \"width\": 1920, \"height\": 1080 } } }" headers = { "x-api-key": "r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://graph.facebook.com/edit/stage/render'; const options = { method: 'POST', headers: { 'x-api-key': 'r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG', 'Content-Type': 'application/json' }, body: '"{\n \"callback\": \"https://{{env.worker_name}}deao.workers.dev/step3\",\n \"timeline\": {\n \"background\": \"#000000\",\n \"tracks\": [\n {\n \"clips\": [ //logo\n {\n \"length\": \"end\",\n \"asset\": {\n \"type\": \"image\",\n \"src\": \"https://musiccast.odoo.com/web/image/3427\"\n },\n \"start\": \"auto\",\n \"transition\": {\n \"in\": \"fadeSlow\",\n \"out\": \"fadeSlow\"\n }\n }\n ]\n },\n {\n \"clips\": [ //videos\n {\n \"length\": \"auto\",\n \"asset\": {\n \"type\": \"video\", //Video 1\n \"src\": \"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\",\n \"volume\": 1\n },\n \"start\": \"auto\",\n \"transition\": {\n \"in\": \"fadeSlow\" //first video\n }\n },\n {\n \"length\": \"auto\",\n \"asset\": {\n \"type\": \"video\", //Video 2\n \"src\": \"https://videos.pexels.com/video-files/....mp4\",\n \"volume\": 1\n },\n \"start\": \"auto\"\n },\n {\n \"length\": \"auto\",\n \"asset\": {\n \"type\": \"video\", //video 3\n \"src\": \"https://videos.pexels.com/video-files/....mp4\",\n \"volume\": 1\n },\n \"start\": \"auto\"\n },\n {\n \"length\": \"end\", // last video\n \"asset\": {\n \"type\": \"video\", // Video 4\n \"src\": \"https://videos.pexels.com/video-files/....mp4\",\n \"volume\": 1\n },\n \"start\": \"auto\",\n \"transition\": {\n \"out\": \"fadeSlow\" //last video\n }\n }\n ]\n },\n {\n \"clips\": [ //audios\n {\n \"length\": \"auto\",\n \"asset\": {\n \"type\": \"audio\", // audio 1\n \"src\": \"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\",\n \"volume\": 1\n },\n \"start\": \"auto\"\n },\n {\n \"length\": \"end\", // last audio\n \"asset\": {\n \"type\": \"audio\", // audio 2\n \"src\": \"https://tempfile.aiquickdraw.com/r/....mp3\",\n \"volume\": 1\n },\n \"start\": \"auto\"\n }\n ]\n }\n ]\n },\n \"output\": {\n \"format\": \"mp4\",\n \"fps\": 30,\n \"size\": {\n \"width\": 1920,\n \"height\": 1080\n }\n }\n}"' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://graph.facebook.com/edit/stage/render" payload := strings.NewReader("\"{\\n \\\"callback\\\": \\\"https://{{env.worker_name}}deao.workers.dev/step3\\\",\\n \\\"timeline\\\": {\\n \\\"background\\\": \\\"#000000\\\",\\n \\\"tracks\\\": [\\n {\\n \\\"clips\\\": [ //logo\\n {\\n \\\"length\\\": \\\"end\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"image\\\",\\n \\\"src\\\": \\\"https://musiccast.odoo.com/web/image/3427\\\"\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\",\\n \\\"out\\\": \\\"fadeSlow\\\"\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //videos\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 1\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\" //first video\\n }\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 2\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //video 3\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last video\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", // Video 4\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"out\\\": \\\"fadeSlow\\\" //last video\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //audios\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 1\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last audio\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 2\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/....mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n }\\n ]\\n }\\n ]\\n },\\n \\\"output\\\": {\\n \\\"format\\\": \\\"mp4\\\",\\n \\\"fps\\\": 30,\\n \\\"size\\\": {\\n \\\"width\\\": 1920,\\n \\\"height\\\": 1080\\n }\\n }\\n}\"") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-api-key", "r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://graph.facebook.com/edit/stage/render") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["x-api-key"] = 'r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG' request["Content-Type"] = 'application/json' request.body = "\"{\\n \\\"callback\\\": \\\"https://{{env.worker_name}}deao.workers.dev/step3\\\",\\n \\\"timeline\\\": {\\n \\\"background\\\": \\\"#000000\\\",\\n \\\"tracks\\\": [\\n {\\n \\\"clips\\\": [ //logo\\n {\\n \\\"length\\\": \\\"end\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"image\\\",\\n \\\"src\\\": \\\"https://musiccast.odoo.com/web/image/3427\\\"\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\",\\n \\\"out\\\": \\\"fadeSlow\\\"\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //videos\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 1\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\" //first video\\n }\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 2\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //video 3\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last video\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", // Video 4\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"out\\\": \\\"fadeSlow\\\" //last video\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //audios\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 1\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last audio\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 2\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/....mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n }\\n ]\\n }\\n ]\\n },\\n \\\"output\\\": {\\n \\\"format\\\": \\\"mp4\\\",\\n \\\"fps\\\": 30,\\n \\\"size\\\": {\\n \\\"width\\\": 1920,\\n \\\"height\\\": 1080\\n }\\n }\\n}\"" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://graph.facebook.com/edit/stage/render") .header("x-api-key", "r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG") .header("Content-Type", "application/json") .body("\"{\\n \\\"callback\\\": \\\"https://{{env.worker_name}}deao.workers.dev/step3\\\",\\n \\\"timeline\\\": {\\n \\\"background\\\": \\\"#000000\\\",\\n \\\"tracks\\\": [\\n {\\n \\\"clips\\\": [ //logo\\n {\\n \\\"length\\\": \\\"end\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"image\\\",\\n \\\"src\\\": \\\"https://musiccast.odoo.com/web/image/3427\\\"\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\",\\n \\\"out\\\": \\\"fadeSlow\\\"\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //videos\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 1\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\" //first video\\n }\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 2\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //video 3\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last video\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", // Video 4\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"out\\\": \\\"fadeSlow\\\" //last video\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //audios\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 1\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last audio\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 2\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/....mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n }\\n ]\\n }\\n ]\\n },\\n \\\"output\\\": {\\n \\\"format\\\": \\\"mp4\\\",\\n \\\"fps\\\": 30,\\n \\\"size\\\": {\\n \\\"width\\\": 1920,\\n \\\"height\\\": 1080\\n }\\n }\\n}\"") .asString(); ``` ```php request('POST', 'https://graph.facebook.com/edit/stage/render', [ 'body' => '"{\\n \\"callback\\": \\"https://{{env.worker_name}}deao.workers.dev/step3\\",\\n \\"timeline\\": {\\n \\"background\\": \\"#000000\\",\\n \\"tracks\\": [\\n {\\n \\"clips\\": [ //logo\\n {\\n \\"length\\": \\"end\\",\\n \\"asset\\": {\\n \\"type\\": \\"image\\",\\n \\"src\\": \\"https://musiccast.odoo.com/web/image/3427\\"\\n },\\n \\"start\\": \\"auto\\",\\n \\"transition\\": {\\n \\"in\\": \\"fadeSlow\\",\\n \\"out\\": \\"fadeSlow\\"\\n }\\n }\\n ]\\n },\\n {\\n \\"clips\\": [ //videos\\n {\\n \\"length\\": \\"auto\\",\\n \\"asset\\": {\\n \\"type\\": \\"video\\", //Video 1\\n \\"src\\": \\"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\\",\\n \\"volume\\": 1\\n },\\n \\"start\\": \\"auto\\",\\n \\"transition\\": {\\n \\"in\\": \\"fadeSlow\\" //first video\\n }\\n },\\n {\\n \\"length\\": \\"auto\\",\\n \\"asset\\": {\\n \\"type\\": \\"video\\", //Video 2\\n \\"src\\": \\"https://videos.pexels.com/video-files/....mp4\\",\\n \\"volume\\": 1\\n },\\n \\"start\\": \\"auto\\"\\n },\\n {\\n \\"length\\": \\"auto\\",\\n \\"asset\\": {\\n \\"type\\": \\"video\\", //video 3\\n \\"src\\": \\"https://videos.pexels.com/video-files/....mp4\\",\\n \\"volume\\": 1\\n },\\n \\"start\\": \\"auto\\"\\n },\\n {\\n \\"length\\": \\"end\\", // last video\\n \\"asset\\": {\\n \\"type\\": \\"video\\", // Video 4\\n \\"src\\": \\"https://videos.pexels.com/video-files/....mp4\\",\\n \\"volume\\": 1\\n },\\n \\"start\\": \\"auto\\",\\n \\"transition\\": {\\n \\"out\\": \\"fadeSlow\\" //last video\\n }\\n }\\n ]\\n },\\n {\\n \\"clips\\": [ //audios\\n {\\n \\"length\\": \\"auto\\",\\n \\"asset\\": {\\n \\"type\\": \\"audio\\", // audio 1\\n \\"src\\": \\"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\\",\\n \\"volume\\": 1\\n },\\n \\"start\\": \\"auto\\"\\n },\\n {\\n \\"length\\": \\"end\\", // last audio\\n \\"asset\\": {\\n \\"type\\": \\"audio\\", // audio 2\\n \\"src\\": \\"https://tempfile.aiquickdraw.com/r/....mp3\\",\\n \\"volume\\": 1\\n },\\n \\"start\\": \\"auto\\"\\n }\\n ]\\n }\\n ]\\n },\\n \\"output\\": {\\n \\"format\\": \\"mp4\\",\\n \\"fps\\": 30,\\n \\"size\\": {\\n \\"width\\": 1920,\\n \\"height\\": 1080\\n }\\n }\\n}"', 'headers' => [ 'Content-Type' => 'application/json', 'x-api-key' => 'r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://graph.facebook.com/edit/stage/render"); var request = new RestRequest(Method.POST); request.AddHeader("x-api-key", "r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "\"{\\n \\\"callback\\\": \\\"https://{{env.worker_name}}deao.workers.dev/step3\\\",\\n \\\"timeline\\\": {\\n \\\"background\\\": \\\"#000000\\\",\\n \\\"tracks\\\": [\\n {\\n \\\"clips\\\": [ //logo\\n {\\n \\\"length\\\": \\\"end\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"image\\\",\\n \\\"src\\\": \\\"https://musiccast.odoo.com/web/image/3427\\\"\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\",\\n \\\"out\\\": \\\"fadeSlow\\\"\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //videos\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 1\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"in\\\": \\\"fadeSlow\\\" //first video\\n }\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //Video 2\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", //video 3\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last video\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"video\\\", // Video 4\\n \\\"src\\\": \\\"https://videos.pexels.com/video-files/....mp4\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\",\\n \\\"transition\\\": {\\n \\\"out\\\": \\\"fadeSlow\\\" //last video\\n }\\n }\\n ]\\n },\\n {\\n \\\"clips\\\": [ //audios\\n {\\n \\\"length\\\": \\\"auto\\\",\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 1\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n },\\n {\\n \\\"length\\\": \\\"end\\\", // last audio\\n \\\"asset\\\": {\\n \\\"type\\\": \\\"audio\\\", // audio 2\\n \\\"src\\\": \\\"https://tempfile.aiquickdraw.com/r/....mp3\\\",\\n \\\"volume\\\": 1\\n },\\n \\\"start\\\": \\\"auto\\\"\\n }\\n ]\\n }\\n ]\\n },\\n \\\"output\\\": {\\n \\\"format\\\": \\\"mp4\\\",\\n \\\"fps\\\": 30,\\n \\\"size\\\": {\\n \\\"width\\\": 1920,\\n \\\"height\\\": 1080\\n }\\n }\\n}\"", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "x-api-key": "r03yYY4E32jxtRTHePtatrONzD16RKZkOn5yTupG", "Content-Type": "application/json" ] let parameters = "{ \"callback\": \"https://{{env.worker_name}}deao.workers.dev/step3\", \"timeline\": { \"background\": \"#000000\", \"tracks\": [ { \"clips\": [ //logo { \"length\": \"end\", \"asset\": { \"type\": \"image\", \"src\": \"https://musiccast.odoo.com/web/image/3427\" }, \"start\": \"auto\", \"transition\": { \"in\": \"fadeSlow\", \"out\": \"fadeSlow\" } } ] }, { \"clips\": [ //videos { \"length\": \"auto\", \"asset\": { \"type\": \"video\", //Video 1 \"src\": \"https://videos.pexels.com/video-files/4324104/4324104-hd_1920_1080_24fps.mp4\", \"volume\": 1 }, \"start\": \"auto\", \"transition\": { \"in\": \"fadeSlow\" //first video } }, { \"length\": \"auto\", \"asset\": { \"type\": \"video\", //Video 2 \"src\": \"https://videos.pexels.com/video-files/....mp4\", \"volume\": 1 }, \"start\": \"auto\" }, { \"length\": \"auto\", \"asset\": { \"type\": \"video\", //video 3 \"src\": \"https://videos.pexels.com/video-files/....mp4\", \"volume\": 1 }, \"start\": \"auto\" }, { \"length\": \"end\", // last video \"asset\": { \"type\": \"video\", // Video 4 \"src\": \"https://videos.pexels.com/video-files/....mp4\", \"volume\": 1 }, \"start\": \"auto\", \"transition\": { \"out\": \"fadeSlow\" //last video } } ] }, { \"clips\": [ //audios { \"length\": \"auto\", \"asset\": { \"type\": \"audio\", // audio 1 \"src\": \"https://tempfile.aiquickdraw.com/r/6e4fdd3b9b3246d592778f4ef0afc289.mp3\", \"volume\": 1 }, \"start\": \"auto\" }, { \"length\": \"end\", // last audio \"asset\": { \"type\": \"audio\", // audio 2 \"src\": \"https://tempfile.aiquickdraw.com/r/....mp3\", \"volume\": 1 }, \"start\": \"auto\" } ] } ] }, \"output\": { \"format\": \"mp4\", \"fps\": 30, \"size\": { \"width\": 1920, \"height\": 1080 } } }" as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://graph.facebook.com/edit/stage/render")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```