curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_url": "https://storage.base44.com/gads-assets/spring-spot.mp4",
"title": "Spring sale spot"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video"
payload = {
"file_url": "https://storage.base44.com/gads-assets/spring-spot.mp4",
"title": "Spring sale spot"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
file_url: 'https://storage.base44.com/gads-assets/spring-spot.mp4',
title: 'Spring sale spot'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_url' => 'https://storage.base44.com/gads-assets/spring-spot.mp4',
'title' => 'Spring sale spot'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video"
payload := strings.NewReader("{\n \"file_url\": \"https://storage.base44.com/gads-assets/spring-spot.mp4\",\n \"title\": \"Spring sale spot\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_url\": \"https://storage.base44.com/gads-assets/spring-spot.mp4\",\n \"title\": \"Spring sale spot\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_url\": \"https://storage.base44.com/gads-assets/spring-spot.mp4\",\n \"title\": \"Spring sale spot\"\n}"
response = http.request(request)
puts response.read_body{
"video_id": "dQw4w9WgXcQ",
"upload_rn": "customers/1234567890/youTubeVideoUploads/AbC123xYz"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Upload a Google Ads video
Uploads a video file to YouTube so you can use it in a campaign.
Google Ads only takes video as a YouTube video, so a file has to reach YouTube before a campaign can show it. Base44 fetches the file from file_url and uploads it as an unlisted video to a YouTube channel Google manages for Base44, not to your own channel. The upload is not tied to a campaign: pass the returned video_id as a campaign video the same way you would pass the ID from a YouTube link. An uploaded video that no campaign uses stays on that channel, unlisted.
The request waits while the file is fetched and uploaded, and then a few seconds more while YouTube assigns the video ID. If YouTube is still processing by then, the response carries an empty video_id and an upload_rn. The upload has succeeded in that case. Do not upload the file again: call Poll a Google Ads video upload with upload_rn every few seconds until video_id comes back. A file that cannot be fetched, one over 64 MB, and a video YouTube rejects return a 400.
Each upload publishes a video, so this is limited to 5 uploads every 5 minutes per app. Some workspaces have a different limit. Polling has its own, looser limit. It is refused with a 409 while the workspace is on a Google Ads billing hold.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_url": "https://storage.base44.com/gads-assets/spring-spot.mp4",
"title": "Spring sale spot"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video"
payload = {
"file_url": "https://storage.base44.com/gads-assets/spring-spot.mp4",
"title": "Spring sale spot"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
file_url: 'https://storage.base44.com/gads-assets/spring-spot.mp4',
title: 'Spring sale spot'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_url' => 'https://storage.base44.com/gads-assets/spring-spot.mp4',
'title' => 'Spring sale spot'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video"
payload := strings.NewReader("{\n \"file_url\": \"https://storage.base44.com/gads-assets/spring-spot.mp4\",\n \"title\": \"Spring sale spot\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_url\": \"https://storage.base44.com/gads-assets/spring-spot.mp4\",\n \"title\": \"Spring sale spot\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_url\": \"https://storage.base44.com/gads-assets/spring-spot.mp4\",\n \"title\": \"Spring sale spot\"\n}"
response = http.request(request)
puts response.read_body{
"video_id": "dQw4w9WgXcQ",
"upload_rn": "customers/1234567890/youTubeVideoUploads/AbC123xYz"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app whose Google Ads creative you want to generate or read.
Body
A video file to upload to YouTube for Google Ads.
Address of the video file. It has to be https on a host Base44 fetches media from, such as an address on base44.com or base44.app, and the file can be at most 64 MB. Base44 does not fetch any other address and rejects it with a 400.
"https://storage.base44.com/gads-assets/spring-spot.mp4"
Title of the unlisted YouTube video. Only the first 100 characters are used. It is shown on the video itself, never in the ad. Leave it out for a generic title.
"Spring sale spot"
Response
The uploaded video, or a reference to poll while YouTube processes it.
A video uploaded to YouTube for Google Ads.
The YouTube video ID. Pass it as a video on a campaign, exactly as you would the ID from a YouTube link. Empty while YouTube is still processing the upload, in which case poll with upload_rn.
"dQw4w9WgXcQ"
Google's reference for the upload. Keep it until video_id is filled in, and pass it to Poll a Google Ads video upload.
"customers/1234567890/youTubeVideoUploads/AbC123xYz"
Was this page helpful?