curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video/poll \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"upload_rn": "customers/1234567890/youTubeVideoUploads/AbC123xYz"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video/poll"
payload = { "upload_rn": "customers/1234567890/youTubeVideoUploads/AbC123xYz" }
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({upload_rn: 'customers/1234567890/youTubeVideoUploads/AbC123xYz'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video/poll', 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/poll",
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([
'upload_rn' => 'customers/1234567890/youTubeVideoUploads/AbC123xYz'
]),
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/poll"
payload := strings.NewReader("{\n \"upload_rn\": \"customers/1234567890/youTubeVideoUploads/AbC123xYz\"\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/poll")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"upload_rn\": \"customers/1234567890/youTubeVideoUploads/AbC123xYz\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video/poll")
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 \"upload_rn\": \"customers/1234567890/youTubeVideoUploads/AbC123xYz\"\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>"
}
]
}Poll a Google Ads video upload
Checks whether YouTube has assigned an ID to a video you uploaded with Upload a Google Ads video.
Send the upload_rn that upload returned. Each call reads the upload’s state from Google once and returns straight away, with video_id empty while YouTube is still processing. Poll every few seconds until it is filled in. Nothing is uploaded again, and polling does not count against the upload limit.
A video YouTube rejected, or one that failed to upload, returns a 400, so upload a different file then. An upload_rn that is not shaped like one, or that belongs to a different Google Ads account, is also rejected with a 400. One that is correctly shaped but names no upload keeps returning an empty video_id, so stop polling after a few minutes.
This is limited to 30 requests a minute per app. Some workspaces have a different 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/poll \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"upload_rn": "customers/1234567890/youTubeVideoUploads/AbC123xYz"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video/poll"
payload = { "upload_rn": "customers/1234567890/youTubeVideoUploads/AbC123xYz" }
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({upload_rn: 'customers/1234567890/youTubeVideoUploads/AbC123xYz'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video/poll', 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/poll",
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([
'upload_rn' => 'customers/1234567890/youTubeVideoUploads/AbC123xYz'
]),
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/poll"
payload := strings.NewReader("{\n \"upload_rn\": \"customers/1234567890/youTubeVideoUploads/AbC123xYz\"\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/poll")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"upload_rn\": \"customers/1234567890/youTubeVideoUploads/AbC123xYz\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video/poll")
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 \"upload_rn\": \"customers/1234567890/youTubeVideoUploads/AbC123xYz\"\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
The reference returned by an upload that was still processing.
The upload_rn that Upload a Google Ads video returned for this app.
"customers/1234567890/youTubeVideoUploads/AbC123xYz"
Response
The upload, with video_id filled in once YouTube has assigned 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?