多账户专用转化 API 网关控制平面 API:参考文档

Pixel 像素代码管理

创建 Pixel 像素代码连接

在转化 API 网关中加入新的 Meta Pixel 像素代码。

结构

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation AddNewPixelModalMutation(
    $tenantId: ID!
    $input: PixelConnectionCreationInput!
) {
    tenantMutations(tenantId: $tenantId) {
          signalMutations {
              setupPixelSignalConfig(input: $input) {
              id
              domains
              connectionId
              connectionStatus {
                  id
                  accessTokenAvailable
                  active
                  connected
                  accessKey
                  eventBridgeActive
                  publishingEnabled
                  apiErrorCode
                  pixelID
                  pixelName
                  lastPublished
                  totalEventsPublished
                  lastReceived
                  totalEventsReceived
                  }
              }
          }
     }
}
_________________________________________________________________________________________________________    
tenantId: ID!
_________________________________________________________________________________________________________
input PixelConnectionCreationInput {
  businessId: String!
  pixelId: String!
  accessToken: String!
  apiVersion: String
  externalId: String!
  name: String
}      
     

字段

字段描述

tenantId
编号

必要

账户的唯一标识符

PixelConnectionCreationInput

字段描述

businessId
字符串

必要

账户的业务编号

pixelId
字符串

必要

需集成的 Pixel 像素代码编号

accessToken
字符串

必要

MBE 设置中或从事件管理工具中手动生成的访问口令

apiVersion
字符串

可选

图谱 API 的最新 API 版本

externalId
字符串

必要

这应与设置对象中的 external_business_id 相同

name
字符串

可选

Pixel 像素代码的名称


响应

字段描述

signalConfig
SignalConfig

Pixel 像素代码配置


错误代码

代码描述

400

提供的输入无效

401

用户未获授权,无法设置 Pixel 像素代码配置

500

内部服务器错误


请求示例

更改

mutation AddNewPixelModalMutation(
   $tenantId: ID!
   $input: PixelConnectionCreationInput!
) {
   tenantMutations(tenantId: $tenantId) {
          signalMutations {
              setupPixelSignalConfig(input: $input) {
              id
              domains
              connectionId
              connectionStatus {
                  id
                  accessTokenAvailable
                  active
                  eventBridgeActive
                  publishingEnabled
                  apiErrorCode
                  pixelID
                  pixelName
                  lastPublished
                  totalEventsPublished
                  lastReceived
                  totalEventsReceived
                  }
              }
          }
   }
}
     

变量

{
   "tenantId": "IaoreXfj",
   "input": {
       "pixelId": "18904456377094531",
       "businessId": "2840127409433732",
       "accessToken": "<accessToken>",
       "apiVersion": "v14.0",
       "externalId": "633612748410ba6e902"
   }
}
     

响应示例

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "setupPixelSignalConfig": {
                   "id": "SignalConfig:18904456377094531",
                   "domains": [],
                   "connectionId": "18904456377094531",
                   "connectionStatus": {
                       "id": "ConnectionStatus:18904456377094531",
                       "accessTokenAvailable": true,
                       "active": true,
                       "eventBridgeActive": true,
                       "publishingEnabled": true,
                       "apiErrorCode": null,
                       "pixelID": "18904456377094531",
                       "pixelName": null,
                       "lastPublished": 0.0,
                       "totalEventsPublished": 0.0,
                       "lastReceived": 0.0,
                       "totalEventsReceived": 0.0
                   }
               }
           }
       }
   }
}
     

删除 Pixel 像素代码连接

从网关中删除现有 Pixel 像素代码。

结构

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation DeleteDataSourceModalMutation(
  $id: ID!
  $tenantId: ID!
) {
  tenantMutations(tenantId: $tenantId) {
    signalMutations {
      deleteDataSource(id: $id)
    }
  }
}
_________________________________________________________________________________________________________    
id: ID!
_____________________________________________________________________________________________________________
      
tenantId: ID!   
     

字段

字段描述

id
编号

必要

Pixel 像素代码编号

tenantId
编号

必要
账户的唯一标识符


响应

字段描述

布尔值

指示是否已成功删除 Pixel 像素代码


错误代码

代码描述

401

用户未获授权,无法移除 Pixel 像素代码配置。

404

找不到 Pixel 像素代码。

500

内部服务器错误


请求示例

更改

mutation DeleteDataSourceModalMutation(
 $id: ID!
 $tenantId: ID!
) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     deleteDataSource(id: $id)
   }
 }
}
     

变量

{
   "id":"18904456377094531",
   "tenantId":"IaoreXfj"
}
     

响应示例

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "deleteDataSource": true
           }
       }
   }
}
     

启用/停用网关接收 Pixel 像素代码事件

更改网关的 Pixel 像素代码事件接收状态。

结构

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation updateSignalConfigStatusMutation(
    $id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
  tenantMutations(tenantId: $tenantId) {
    signalMutations {
      updateSignalConfigEventsStatus(id: $id, input: $input) {
        success
        connectionStatus {
            id
            accessTokenAvailable
            active
            connected
            accessKey
            eventBridgeActive
            publishingEnabled
            apiErrorCode
            pixelID
            pixelName
            lastPublished
            totalEventsPublished
            lastReceived
            totalEventsReceived
        }
      }
    }
  }
}
_________________________________________________________________________________________________________    
id: ID!
_____________________________________________________________________________________________________________
      
tenantId: ID!
________________________________________________________________________________________________________
input SignalConfigStatusInput {
  status: Int!
}            
     

字段

字段描述

id
编号

必要

需配置的 Pixel 像素代码编号

tenantId
编号

必要
账户的唯一标识符


SignalConfigStatusInput

字段描述

status
整数

必要


描述

0

停用

1

启用


响应

UpdateSignalConfigStatusPayload

字段描述

success
布尔值

指示对 Pixel 像素代码执行的操作是否成功

connectionStatus
ConnectionStatus

Pixel 像素代码连接配置


错误代码

代码描述

401

未获授权,无法对 Pixel 像素代码执行操作

500

内部服务器错误


请求示例

更改

mutation updateSignalConfigStatusMutation(
   $id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     updateSignalConfigEventsStatus(id: $id, input: $input) {
       success
       connectionStatus {
         id
         connected
         active
         eventBridgeActive
         publishingEnabled
       }
     }
   }
 }
}
     

变量

{
   "id": "18904456377094531",
   "tenantId": "IaoreXfj",
   "input": {
       "status": 1
       }
}
     

响应示例

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "updateSignalConfigEventsStatus": {
                   "success": true,
                   "connectionStatus": {
                       "id": "ConnectionStatus:18904456377094531",
                       "connected": true,
                       "active": true,
                       "eventBridgeActive": true,
                       "publishingEnabled": true
                   }
               }
           }
       }
   }
}
     

启用/停用 Pixel 像素代码事件发布状态

更改 Pixel 像素代码的事件发布状态。如果停用,网关将放弃收到的事件,且不会发布到 Meta。

结构

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation updateSignalConfigCapiPublishMutation(
$id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     updateSignalConfigCapiPublish(id: $id, input: $input) {
       success
       connectionStatus {
           id
           accessTokenAvailable
           active
           connected
           accessKey
           eventBridgeActive
           publishingEnabled
           apiErrorCode
           pixelID
           pixelName
           lastPublished
           totalEventsPublished
           lastReceived
           totalEventsReceived
       }
     }
   }
 }
}
_________________________________________________________________________________________________________    
id: ID!
_____________________________________________________________________________________________________________
      
tenantId: ID!
________________________________________________________________________________________________________
input SignalConfigStatusInput {
  status: Int!
}            
     

字段

字段描述

id
编号

必要

需配置的 Pixel 像素代码编号

tenantId
编号

必要
账户的唯一标识符


SignalConfigStatusInput

字段描述

status
整数

必要


描述

0

停用

1

启用


响应

UpdateSignalConfigStatusPayload

字段描述

success
布尔值

指示对 Pixel 像素代码执行的操作是否成功

connectionStatus
ConnectionStatus

Pixel 像素代码连接配置


错误代码

代码描述

401

未获授权,无法对 Pixel 像素代码执行操作

500

内部服务器错误


请求示例

更改

mutation updateSignalConfigCapiPublishMutation(
$id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     updateSignalConfigCapiPublish(id: $id, input: $input) {
       success
       connectionStatus {
         id
         active
         eventBridgeActive
         publishingEnabled
       }
     }
   }
 }
}
     

变量

{
   "id": "18904456377094531",
   "tenantId": "IaoreXfj",
   "input": {
       "status": 0
       }
}
     

响应示例

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "updateSignalConfigCapiPublish": {
                   "success": true,
                   "connectionStatus": {
                       "id": "ConnectionStatus:18904456377094531",
                       "active": false,
                       "eventBridgeActive": true,
                       "publishingEnabled": false
                   }
               }
           }
       }
   }
}
     

启用/停用根据事件名称更改 Pixel 像素代码事件发布状态

根据事件名称和 Pixel 像素代码编号更改 Pixel 像素代码的事件发布状态。如果停用,网关将放弃这些事件,且不会发布到 Meta。

结构

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation EventFilterStatusMutation($tenantId: ID!, $input: UpdateEventFilterInput!) {
 tenantMutations(tenantId: $tenantId) {
   updateEventFilter(input: $input) {
     updatedFilter {
       id
       eventName
       pixelId
       filterState
     }
   }
 }
}
_________________________________________________________________________________________________________    
tenantId: ID!
_____________________________________________________________________________________________________________
      
input UpdateEventFilterInput {
  eventName: String!
  pixelIds: [String!]
  filterState: EventFilterState!
}            
     

字段

字段描述

tenantId
编号

必要
账户的唯一标识符


UpdateEventFilterInput

字段描述

eventName
字符串

必要

要筛选的事件名称

pixelIds
字符串

可选

需应用筛选条件的 Pixel 像素代码编号列表。如果设置为 null,则更新账户的所有 Pixel 像素代码

filterState
EventFilterState

必要

筛选状态


响应

UpdateEventFilterResult

字段描述

updatedFilter
EventFilter

已更新事件筛选条件


错误代码

代码描述

401

未获授权,无法更新事件筛选条件

500

内部服务器错误


请求示例

更改

mutation EventFilterStatusMutation($tenantId: ID!, $input: UpdateEventFilterInput!) {
tenantMutations(tenantId: $tenantId) {
  updateEventFilter(input: $input) {
    updatedFilter {
      eventName
      pixelId
      filterState
    }
  }
}
}
     

变量

{
"tenantId": "IaoreXfj",
"input": {
  "eventName": "AddToCart",
  "pixelIds": ["18904456377094531"],
  "filterState": "PUBLISH"
}
}
     

响应示例

{
   "data": {
       "tenantMutations": {
           "updateEventFilter": {
               "updatedFilter": {
                   "eventName": "AddToCart",
                   "pixelId": "18904456377094531",
                   "filterState": "PUBLISH"
               }
           }
       }
   }
}
     

屏蔽/取消屏蔽允许接收和发布事件的网站

阻止接收特定网站的事件。

结构

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation useComitDomainFilterChangeMutation($tenantId: ID!, $input: UpdateDomainFilterInput!) {
  tenantMutations(tenantId: $tenantId) {
    updateDomainFilter(input: $input) {
      updatedFilter {
        id
        domain
        pixelId
        filterState
      }
    }
  }
}
_________________________________________________________________________________________________________    
tenantId: ID!
_____________________________________________________________________________________________________________
      
input UpdateDomainFilterInput {
  domain: String!
  pixelIds: [String!]
  filterState: DomainFilterState!
}            
     

字段

字段描述

tenantId
编号

必要
账户的唯一标识符


UpdateDomainFilterInput

字段描述

domain
字符串

必要

要筛选的网域名称


格式应为 example.com

pixelIds
字符串

可选

需应用筛选条件的 Pixel 像素代码编号列表

filterState
DomainFilterState

必要

筛选状态


响应

UpdateDomainFilterResult

字段描述

updatedFilter
DomainFilter

网域筛选对象


错误代码

代码描述

401

未获授权,无法更新网域筛选条件

500

内部服务器错误


请求示例

更改

mutation useComitDomainFilterChangeMutation($tenantId: ID!, $input: UpdateDomainFilterInput!) {
 tenantMutations(tenantId: $tenantId) {
   updateDomainFilter(input: $input) {
     updatedFilter {
       id
       domain
       pixelId
       filterState
     }
   }
 }
}
     

变量

{
 "tenantId": "IaoreXfj",
 "input": {
   "domain": "example.com",
   "filterState": "DROP"
 }
}
     

响应示例

"data": {
       "tenantMutations": {
           "updateDomainFilter": {
               "updatedFilter": {
                   "id": "DomainFilter:example.com:global",
                   "domain": "example.com",
                   "pixelId": null,
                   "filterState": "DROP"
               }
           }
       }
   }