Update portfolio bid strategy
curl --request PATCH \
--url https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}', 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/bid-strategies/{strategyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
]),
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://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"strategy": {
"customerId": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}广告系列
Update portfolio bid strategy
Ad Campaigns. Can spend money or change spend: needs the ads:spend scope and X-Aisa-Confirm: spend; without the header the request is refused with confirmation_required and nothing is sent. Changes a portfolio bid strategy’s targets, and so what its campaigns bid. Renames a shared Google Ads bid strategy or changes its target CPA or ROAS. The strategy’s status is output only on Google’s side, so it cannot be changed here; remove a strategy in Google Ads. ### When to send type type is only needed alongside targetCpa/targetRoas, to disambiguate the field Google writes to: TARGET_CPA and MAXIMIZE_CONVERSIONS both take a target CPA.
PATCH
https://api.aisa.one
/
apis
/
v1
/
ads
/
bid-strategies
/
{strategyId}
Update portfolio bid strategy
curl --request PATCH \
--url https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}', 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/bid-strategies/{strategyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
]),
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://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"strategy": {
"customerId": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}请求规范
- 方法与路径: PATCH /apis/v1/ads/bid-strategies/{strategyId}
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/ads/bid-strategies/{strategyId} - strategyId: path; 必填
- connectionId: query; 必填
- X-Aisa-Confirm: header; 可选
{
"operationId": "patch_aisa_ads_apis_v1_ads_bid_strategies_strategyid",
"method": "PATCH",
"path": "/apis/v1/ads/bid-strategies/{strategyId}",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Numeric Google Ads bid strategy id.",
"in": "path",
"name": "strategyId",
"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": "Required with the value \"spend\" when the request can spend money or change spend. Without it the request is refused with 409 confirmation_required, which describes what would happen; nothing is sent to the ad platform.",
"in": "header",
"name": "X-Aisa-Confirm",
"required": false,
"schema": {
"enum": [
"spend"
],
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"adAccountId": "act_1234567890",
"connectionId": "adc_7f3k2m9q",
"name": "Winter launch"
},
"schema": {
"additionalProperties": true,
"properties": {
"adAccountId": {
"description": "Platform ad account ID (Google customer ID, digits only). Defaults to the account's connected customer.",
"type": "string"
},
"connectionId": {
"description": "The ads connection (adc_...), when not sent as the connectionId query parameter.",
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
},
"customerId": {
"description": "Alias of adAccountId, kept for existing callers",
"type": "string"
},
"name": {
"maxLength": 255,
"minLength": 1,
"type": "string"
},
"targetCpa": {
"exclusiveMinimum": 0,
"type": "number"
},
"targetImpressionShare": {
"additionalProperties": false,
"description": "Retargets a TARGET_IMPRESSION_SHARE strategy; location, percent and maxCpc are all written.",
"properties": {
"location": {
"enum": [
"ANYWHERE_ON_PAGE",
"TOP_OF_PAGE",
"ABSOLUTE_TOP_OF_PAGE"
],
"type": "string"
},
"maxCpc": {
"description": "Max CPC bid limit, in the account's currency units. Google requires it.",
"exclusiveMinimum": 0,
"type": "number"
},
"percent": {
"description": "Target share of impressions, in percent (65 = 65%). Sent to Google as location_fraction_micros (1% = 10,000).",
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
}
},
"required": [
"location",
"maxCpc",
"percent"
],
"type": "object"
},
"targetRoas": {
"exclusiveMinimum": 0,
"type": "number"
},
"type": {
"enum": [
"TARGET_CPA",
"TARGET_ROAS",
"MAXIMIZE_CONVERSIONS",
"MAXIMIZE_CONVERSION_VALUE",
"TARGET_IMPRESSION_SHARE"
],
"type": "string"
}
},
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
此操作不另收费。 广告投放费用由广告平台向已连接的广告账户另行收取。授权
请求头
查询参数
请求体
application/json