Read a campaign's ad schedule (dayparting)
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule', 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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cachedAt": "2023-11-07T05:31:56Z",
"campaignId": "<string>",
"performance": {
"byDayOfWeek": [
{
"clicks": 123,
"conversions": 123,
"cost": 123,
"dayOfWeek": "MONDAY",
"impressions": 123
}
],
"byHour": [
{
"clicks": 123,
"conversions": 123,
"cost": 123,
"hour": 11,
"impressions": 123
}
],
"windowDays": 123
},
"schedule": [
{
"bidModifier": 123,
"criterionId": "<string>",
"dayOfWeek": "MONDAY",
"endHour": 12,
"endMinute": 0,
"resourceName": "<string>",
"startHour": 11,
"startMinute": 0
}
],
"servesAroundTheClock": true,
"stale": true
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Campaigns
Read a campaign's ad schedule (dayparting)
Ad Campaigns. Read only. Shows the days and hours a Google campaign runs and its bid adjustments, optionally with performance by day and hour. The windows a Google campaign serves in, with the bid modifier on each, plus the criterion ids Google minted for them. An EMPTY schedule is meaningful and is not a failed lookup: Google has no “all day” criterion, so a campaign with no ad schedule serves around the clock.
GET
https://api.aisa.one
/
apis
/
v1
/
ads
/
campaigns
/
{campaignId}
/
ad-schedule
Read a campaign's ad schedule (dayparting)
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule', 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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cachedAt": "2023-11-07T05:31:56Z",
"campaignId": "<string>",
"performance": {
"byDayOfWeek": [
{
"clicks": 123,
"conversions": 123,
"cost": 123,
"dayOfWeek": "MONDAY",
"impressions": 123
}
],
"byHour": [
{
"clicks": 123,
"conversions": 123,
"cost": 123,
"hour": 11,
"impressions": 123
}
],
"windowDays": 123
},
"schedule": [
{
"bidModifier": 123,
"criterionId": "<string>",
"dayOfWeek": "MONDAY",
"endHour": 12,
"endMinute": 0,
"resourceName": "<string>",
"startHour": 11,
"startMinute": 0
}
],
"servesAroundTheClock": true,
"stale": true
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: GET /apis/v1/ads/campaigns/{campaignId}/ad-schedule
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/ad-schedule - campaignId: path; required
- connectionId: query; required
- platform: query; optional
- includePerformance: query; optional
- windowDays: query; optional
- fromDate: query; optional
- toDate: query; optional
{
"operationId": "get_aisa_ads_apis_v1_ads_campaigns_campaignid_ad__83a9a8",
"method": "GET",
"path": "/apis/v1/ads/campaigns/{campaignId}/ad-schedule",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Numeric Google platform campaign id.",
"in": "path",
"name": "campaignId",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "The ads connection (adc_...) the request runs on: one of yours, from GET /apis/v1/ads/connections. On a request with a JSON body it may be sent as a top-level body member instead.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
}
},
{
"description": "Disambiguates the campaign id when the connection spans platforms.",
"in": "query",
"name": "platform",
"required": false,
"schema": {
"enum": [
"google"
],
"type": "string"
}
},
{
"description": "Also return delivery by day of week and by hour. Costs one extra Google call.",
"in": "query",
"name": "includePerformance",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"description": "Trailing window for the performance split. Ignored when fromDate and toDate are both given.",
"in": "query",
"name": "windowDays",
"required": false,
"schema": {
"default": 30,
"maximum": 90,
"minimum": 1,
"type": "integer"
}
},
{
"description": "Start of an explicit performance range (YYYY-MM-DD). Use together with toDate.",
"in": "query",
"name": "fromDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "End of an explicit performance range (YYYY-MM-DD). Must be on or after fromDate.",
"in": "query",
"name": "toDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation. Ad spend is billed separately by the ad platform to your connected ad account.Authorizations
Query Parameters
Response
The campaign's ad schedule