Read an ad account's campaigns and ad sets live
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/accounts/live \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/accounts/live"
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/accounts/live', 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/accounts/live",
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/accounts/live"
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/accounts/live")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/accounts/live")
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{
"adAccountId": "<string>",
"adSets": [
{
"adSchedule": [
{}
],
"adSetName": "<string>",
"bidAmount": 123,
"bidStrategy": "<string>",
"billingEvent": "<string>",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetMode": "<string>",
"budgetRemaining": 123,
"configuredStatus": "<string>",
"dailyBudget": 123,
"lifetimeBudget": 123,
"optimizationGoal": "<string>",
"platformAdSetId": "<string>",
"platformAdSetStatus": "<string>",
"platformCampaignId": "<string>",
"promotedObject": {},
"schedule": {
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z"
},
"status": "<string>",
"targeting": {}
}
],
"campaigns": [
{
"bidStrategy": "<string>",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetMode": "<string>",
"budgetRemaining": 123,
"campaignName": "<string>",
"configuredStatus": "<string>",
"dailyBudget": 123,
"lifetimeBudget": 123,
"platformCampaignId": "<string>",
"platformCampaignStatus": "<string>",
"spendCap": 123,
"status": "<string>"
}
],
"connectionId": "<string>",
"currency": "<string>",
"paging": {
"adSets": {
"after": "<string>"
},
"campaigns": {
"after": "<string>"
}
},
"platform": "facebook",
"readAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}账户与权限
Read an ad account's campaigns and ad sets live
Ad Accounts. Read only. Reads an ad account’s campaigns and ad sets straight from Meta or TikTok, so checks like budget limits see current values. It reads one Meta ad account or TikTok advertiser live from the platform, so it is cheap enough to run before every write. For example, a per-ad-account spend ceiling that must see the current daily / lifetime budget rather than the synced copy.
GET
https://api.aisa.one
/
apis
/
v1
/
ads
/
accounts
/
live
Read an ad account's campaigns and ad sets live
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/accounts/live \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/accounts/live"
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/accounts/live', 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/accounts/live",
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/accounts/live"
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/accounts/live")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/accounts/live")
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{
"adAccountId": "<string>",
"adSets": [
{
"adSchedule": [
{}
],
"adSetName": "<string>",
"bidAmount": 123,
"bidStrategy": "<string>",
"billingEvent": "<string>",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetMode": "<string>",
"budgetRemaining": 123,
"configuredStatus": "<string>",
"dailyBudget": 123,
"lifetimeBudget": 123,
"optimizationGoal": "<string>",
"platformAdSetId": "<string>",
"platformAdSetStatus": "<string>",
"platformCampaignId": "<string>",
"promotedObject": {},
"schedule": {
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z"
},
"status": "<string>",
"targeting": {}
}
],
"campaigns": [
{
"bidStrategy": "<string>",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetMode": "<string>",
"budgetRemaining": 123,
"campaignName": "<string>",
"configuredStatus": "<string>",
"dailyBudget": 123,
"lifetimeBudget": 123,
"platformCampaignId": "<string>",
"platformCampaignStatus": "<string>",
"spendCap": 123,
"status": "<string>"
}
],
"connectionId": "<string>",
"currency": "<string>",
"paging": {
"adSets": {
"after": "<string>"
},
"campaigns": {
"after": "<string>"
}
},
"platform": "facebook",
"readAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}请求规范
- 方法与路径: GET /apis/v1/ads/accounts/live
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/ads/accounts/live - connectionId: query; 必填
- adAccountId: query; 必填
- status: query; 可选
- level: query; 可选
- limit: query; 可选
- after: query; 可选
{
"operationId": "get_aisa_ads_apis_v1_ads_accounts_live",
"method": "GET",
"path": "/apis/v1/ads/accounts/live",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"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": "Meta ad account id (act_) or TikTok advertiser id (digits).",
"in": "query",
"name": "adAccountId",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated Meta `effective_status` values to keep: ACTIVE, PAUSED, IN_PROCESS, WITH_ISSUES, DELETED, ARCHIVED, and CAMPAIGN_PAUSED (ad sets only; the campaigns level ignores it). Defaults to every status except DELETED and ARCHIVED.",
"in": "query",
"name": "status",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Read only one level. Required with `after`. Both levels are read when omitted.",
"in": "query",
"name": "level",
"required": false,
"schema": {
"enum": [
"campaign",
"adSet"
],
"type": "string"
}
},
{
"description": "Maximum rows per level in this response.",
"in": "query",
"name": "limit",
"required": false,
"schema": {
"default": 200,
"maximum": 500,
"minimum": 1,
"type": "integer"
}
},
{
"description": "Cursor from `paging.campaigns.after` or `paging.adSets.after` of a previous response. Requires `level` (and on TikTok the same `limit`).",
"in": "query",
"name": "after",
"required": false,
"schema": {
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
此操作不另收费。 广告投放费用由广告平台向已连接的广告账户另行收取。授权
查询参数
响应
Live campaigns and ad sets