VI | EN
Nhắn Messenger
Dành cho developer

Cập nhật cài đặt tài khoản (theo dõi chuyển đổi, URL theo dõi…) — API Google Ads

CustomerService.MutateCustomer · gọi qua Quantri360 bằng một API key cho chính tài khoản / tài sản bạn đã kết nối và ủy quyền — 360 lo việc ký request và làm mới phiên đăng nhập bạn đã cấp.

CustomerService.MutateCustomer

POST/{version}/customers/{customer_id}:mutateGọi qua 360: POST https://partner.quantri360.com/v1/google/{version}/customers/{customer_id}:mutate
Endpoint ghi — thay đổi dữ liệu trên Google Ads. Key phải được tạo với tick "Cho phép gọi API ghi", nếu không sẽ nhận 403 write_not_allowed. Mỗi lần gọi được ghi nhật ký.
Mô tả API

Cập nhật cài đặt tài khoản (tự gắn thẻ, URL theo dõi, theo dõi chuyển đổi…). ENDPOINT GHI.

Request

Địa chỉ

POST https://partner.quantri360.com/v1/google/{version}/customers/{customer_id}:mutate

Xác thực & gian hàng

TênVị tríKiểuMẫuMô tả
AuthorizationheaderheaderBearer q360_live_ab12cd34_…Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand.
platform_shop_idquerystring1234567890Customer ID Google Ads (chỉ số) brand đã nối với 360 — lấy ở GET /v1/platforms; phải trùng customers/{customer_id} trong đường dẫn.

Tham số request

TênVị tríKiểuBắt buộcMẫuMô tả
versionpathstringCóv23Phiên bản Google Ads API — dùng bản đang hỗ trợ (v23 trở lên tại 10/2026). Google gỡ bản cũ định kỳ: bản đã gỡ trả trang lỗi HTML 404, bản sắp gỡ trả UNSUPPORTED_VERSION.
customer_idpathstringCó1234567890Customer ID (chỉ số, không gạch) đã nối với 360.
operationbodyobjectCó{"update":{"resourceName":"customers/1234567890","autoTaggingEnabled":true},"updateMask":"autoTaggingEnabled"}MỘT thao tác update (resourceName = chính tài khoản) + updateMask.
validateOnlybodyboolKhôngfalsetrue = Google chỉ kiểm tra hợp lệ, KHÔNG thay đổi (phản hồi {}) — nên thử trước.

Ví dụ request

curl -s -X POST "https://partner.quantri360.com/v1/google/v23/customers/1234567890:mutate" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"operation":{"update":{"resourceName":"customers/1234567890","autoTaggingEnabled":true},"updateMask":"autoTaggingEnabled"}}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/google/v23/customers/1234567890:mutate",
    params={},
    json={
        "operation": {
            "update": {
                "resourceName": "customers/1234567890",
                "autoTaggingEnabled": True
            },
            "updateMask": "autoTaggingEnabled"
        }
    },
    headers={"Authorization": f"Bearer {KEY}"},
    timeout=60,
)
print(r.status_code)
print(r.json())
Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/google/v23/customers/1234567890:mutate');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"operation":{"update":{"resourceName":"customers/1234567890","autoTaggingEnabled":true},"updateMask":"autoTaggingEnabled"}}),
});
console.log(r.status, await r.json());
PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/google/v23/customers/1234567890:mutate' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"operation":{"update":{"resourceName":"customers/1234567890","autoTaggingEnabled":true},"updateMask":"autoTaggingEnabled"}}');
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Tham số phản hồi (nguyên của Google Ads)

TênKiểuMẫuMô tả
resultobject{resourceName}

Bắt đầu dùng

  1. Đăng ký tài khoản Partner
  2. Mở loại dữ liệu thuộc nhóm Google Ads ở trang nền tảng
  3. Tạo API key (tick kênh Google Ads)
  4. Gọi theo ví dụ ở trên