API

1、开户请求列表

获取所有的申请单ID,发出get请求

例子

GET /get_request_list HTTP/1.1
Host: /api/v1/

请求参数:
{
    "id": <String>,
    "access_token": <String>,
    "req_header": {
        "search_id": <String>
    }
}
字段类型注释
idString该申请ID之后所有新增开户申请
access_tokenString联系开发人员获取token,token是和公司主体绑定的
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
​        "code": <Int>,
        "message": <String>
​        "search_id": <String>
​    },
    "data": {
​        "list": List<String>
​    }
}
字段类型注释
codeInt返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求
listList<String>所有oe_request_id列表

错误代码:

错误描述
1001系统异常

2、开户请求详情

获取开户请求详情接口,返回开户申请单的所有字段,get请求

例子:

GET /get_request_detail HTTP/1.1 
Host: /api/v1/

请求参数:
{

    "id": <String>,
    "access_token": <String>,

    "req_header": {
​        "search_id": <String>

 ​    }

}
字段类型注释
idString申请单ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <Int> ,
        "message": <String> ,
        "search_id": <String>
    },
    "data": {
        "id": <String> ,
        "ad_account_creation_request_id": {
        "id": <String>
    },
    "ad_account_creation_request_status": <String> ,
    "ad_account_number": <Int> ,
    "ad_accounts_info": [{
        "ad_account_name": <String> ,
        "timezone_id": <Int> ,
        "account_type": <Int>
    }],
    "business_manager_id": <String> ,
    "business_registration": <String> ,
    "business_registration_id": <String> ,
    "chinese_address": <String> ,
    "chinese_legal_entity_name": <String> ,
    "city": <String> ,
    "contact": <String> ,
    "disapprove_reason": <String> ,
    "official_website_url": <String> ,
    "payment_type": <String> ,
    "phone_number": {
        "id": <String> ,
        "phone_number": <String>
    },
    "planning_agency_name": <String> ,
    "promotable_page_ids": <List> ,
    "promotable_pages": [{
        "pageID": <String> ,
        "pageName": <String> ,
        "isPagePublished": <Bool>
    }],
    "promotable_app_ids": <List> ,
    "promotable_urls": <List> ,
    "request_changes_reason": <String> ,
    "reviewed_user": <String> ,
    "spend_limit": <Int> ,
    "status": "<String>",
    "subvertical": <String> ,
    "subvertical_v2": <String> ,
    "time_created": <Datetime> ,
    "time_updated": <Datetime> ,
    "time_zone": "<Int>",
    "token": {
        "id": <String> ,
        "link_with_id": <String>
    },
    "user_id": <String> ,
    "user_name": <String> ,
    "used_reseller_link": <Bool> ,
    "vertical": "<String>",
    "vertical_v2": "<String>",
    "viewed_by_reseller": <Bool> ,
    "zip_code": "<String>",
    "ad_account_limit": <Int> ,
    "org_ad_account_count": <Int>
}
字段类型注释
resp_header:Object
codeInt返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求
dataObject
idString申请单ID
ad_account_creation_request_id:Object
idString获取账号的请求ID
ad_account_creation_request_statusStringfacebook审核状态:
正在审查的上诉appeal_under_review
待审核pending
要求更改requested_change
正在审查under_review
上诉获得批准appeal_approved
审核通过approved
自动拒绝auto_disapproved
上诉被驳回appeal_disapproved
拒绝disapproved
自动批准auto_approved
ad_account_numberInt申请的账号个数
ad_accounts_infoJsonArray
ad_account_nameString申请账号名称
timezone_idInt时区
account_typeInt账号类型
business_manager_idStringBM ID
business_registrationString营业执照下载地址
business_registration_idString营业执照ID
chinese_addressString中文地址
chinese_legal_entity_nameString公司名称
cityString城市
contactString邮箱
disapprove_reasonString被拒原因
official_website_urlString官网链接
payment_typeString付款类型
phone_numberObject
idString电话ID
phone_numberString电话
planning_agency_nameString供应商信息
promotable_page_idsList<String>粉丝页ID
promotable_pagesJsonArray
pageIDString粉丝ID
pageNameString粉丝页名称
isPagePublishedBool是否公开发布
promotable_app_idsList<String>应用ID
promotable_urlsList<String>推广链接
request_changes_reasonString申请修改原因
reviewed_userString已审核用户
spend_limitInt花费上限
statusString申请单状态
subverticalString子行业-老版本
subvertical_v2String子行业-新版本
time_createdString申请单创建时间
time_updatedString申请单更新时间
time_zoneInt时区
tokenObject
idStringtoken ID
link_with_idString填写申请单的地址
user_idString用户ID,提交人的ID
user_nameString用户名称,提交人的用户名
used_reseller_linkBool是否使用经销商链接
verticalString行业-老版本
vertical_v2String行业-新版本
viewed_by_resellerBool是否被经销商查看
zip_codeString邮政编码
ad_account_limitInt账号个数上限
org_ad_account_countInt原账号个数

错误编码

编码注释
1001系统异常

3、下户详情接口

获取下户详情,包含账号信息,account_id,account_name等,get请求

GET /get_aac_request_detail  HTTP/1.1  
Host: /api/v1/ 
请求参数: 
{     
    "ad_account_creation_request_id": <String>,     
    "access_token": <String>,     
    "req_header": { ​        
    "search_id": <String>  ​    
    }  
}
字段类型注释
ad_account_creation_request_idString获取账号的请求ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <Int> ,
        "message": <String> ,
        "search_id": <String>
    },
    "data": {
        "id": <String>,
        "status": <String>,
        "contact": {
        "name": <String> ,
        "email": <String>
    },
    "disapproval_reasons": [{
        "reason": <String> ,
        "note": <String>
    }],
    "request_change_reasons": [{
    "field": <String> ,
    "reason": <String> ,
    "note": <String>
    }],
    "official_website_url": <String> ,
    "legal_entity_name_in_local_language": <String> ,
    "address_in_local_language": <String> ,
    "promotable_page_ids": <List> ,
    "promotable_urls": <List> ,
    "promotable_app_ids": <List> ,
    "business_registration_id": <String> ,
    "vertical_v2": <String> ,
    "subvertical_v2": <String> ,
    "adaccounts": {
        "data": [{
            "name": <String> ,
            "account_id": <String> ,
        }]
    }
}
字段类型注释
codeInt返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求
dataObject
idString获取账号的请求ID
statusString下户状态
contactObject
nameString提交申请的人员名称
emailString联系邮箱
disapproval_reasonsObject
reasonString审批不通过的原因
noteString原因的详细注释
request_change_reasonsObject
fieldString申请需要修改的字段
reasonString申请需要修改的原因
noteString原因的详细解释
official_website_urlString官网
legal_entity_name_in_local_languageString开户公司名称
address_in_local_languageString地址
promotable_page_idsList<String>粉丝页ID列表
promotable_urlsList<String>推广链接列表
promotable_app_idsList<String>应用ID列表
business_registration_idString营业执照ID
vertical_v2String行业-新版本
subvertical_v2String子行业-新版本
adaccountsObject
dataJsonArray
nameString账号名称
account_idString账号ID

错误编码

编码注释
1001系统异常

4、修改账户额度接口

通过接口修改账号的消耗上限,post请求

POST /change_spend_cap  HTTP/1.1   
Host: /api/v1/  
请求参数:  
{          
    "id": <String>,          
    "access_token": <String>,
    "amount_usd": <Decimal>          
    "req_header": { ​             
        "search_id": <String>  ​         
    }   
}
字段类型注释
idString账号ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
amount_usdDecimal金额美分
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <String>,
        "message": <String>,
        "search_id": <String>
    }
}
字段类型注释
codeString返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1004amount_usd 不能为空
1005amount_usd 参数无效
1007amount_usd 金额设置过低(spend_cap不能小于等于0)
1011Facebook API 请求超时
1013广告账户状态异常
1020该广告账户已被设置成违规账户
1021该广告账户的开户公司已被列入黑名单

5、账户绑定Business Manager

通过接口,account_id绑定BM,POST请求

POST /account_binding_bm  HTTP/1.1    
Host: /api/v1/   
请求参数:   
{               
    "id": <String>,               
    "access_token": <String>,     
    "business_id": <String>,               
    "req_header": { ​                      
        "search_id": <String>  ​              
    }    
}
字段类型注释
idString广告账户ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
business_idStringBusiness Manager Id
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header":{
        "code":,
        "message": ,
        "search_id":
    }
}
字段类型注释
codeString返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1008business_id 不能为空
1011Facebook API 请求超时

6、账户解除Business Manager 绑定

通过接口,解除已绑定的BM,POST请求

POST /account_remove_bm  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>,          
    "business_id": <String>,                    
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString广告账户ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
business_idStringBusiness Manager Id
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header":{
        "code":,
        "message": ,
        "search_id":
    }
}
字段类型注释
codeString返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1008business_id 不能为空
1011Facebook API 请求超时
1022Meta广告账户解绑BM功能暂停

7、Business Manager 列表

接口实现了通过账号ID,获取次账号绑定的BM列表,GET请求。

GET /account_business_list  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>,          
    "fields": List<String>,                    
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString广告账户ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
fieldsList<String>查询的字段 eg:[‘id’,’name’,’permitted_tasks’]
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header":{
        "code": <Int>,
        "message" <String>:,
        "search_id" <String>:
}
    "data":[{
        "id": <String>,
        "name" <String>:,
        "permitted_tasks": List<String>,
        ...
    }]
}
字段类型注释
codeInt返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求
dataObject
idStringBM ID
nameStringBM名称
permitted_tasksList<String>被允许的任务列表

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1008business_id 不能为空
1011Facebook API 请求超时
1022Meta广告账户解绑BM功能暂停

8、广告账号重置

通过结构,设置spend_cap:0.01; amount_spent:0 ,POST请求

POST /account_spend_cap_reset  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>,                   
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString广告账户ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
search_idString唯一标识一个请求

返回的结果

{
    "resp_header":{
        "code":,
        "message": ,
        "search_id":
    }
}
字段类型注释
codeString返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1011Facebook API 请求超时
1013广告账户状态异常

9、广告账户信息

通过接口,获取账号详细的信息,GET请求

GET /account_info  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>,          
    "fields": List<String>,                    
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString广告账户ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
fieldsList<String>查询的账户字段 eg[:’id’,’account_id’,’name’] 根据传入的字段返回相应字段值
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <Int> ,
        "message": <String> ,
        "search_id": <String>
    },
    "data": {
        "account_id": <String> , // 广告账户ID
        "name": <String> , // 广告账户名称
        "spend_cap": <Int> , // 额度-美分
        "amount_spent": <Int> , // 美分
        "account_status": <Int> , // 广告账户状态
        "created_time": <String> ,
        "disable_reason": <Int>
        ……
    }
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求
dataObject
account_idString广告账户ID
nameString广告账户名称
spend_capInt额度-美分
amount_spentInt帐户当前花费的总金额
account_statusInt广告账户状态
created_timeString创建时间
disable_reasonInt帐户被禁用的原因
……

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1009fields 不能为空
1010fields 参数无效
1011Facebook API 请求超时

10、广告账户消耗信息

通过账号ID,时间范围,spend,purchase_roas等条件查询账号的消耗数据,GET请求。

GET /account_insights  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>, 
    "time_range":{
        "since":<Date>,
        "until":<Date>,
    },
    "date_preset":<String>,  // 如果传入time_range则忽略该字段
    "fields": List<String>, 
    "time_increment":<String>,                   
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString广告账户ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
sinceDate开始时间,YYYY-MM-DD
untilDate结束时间,YYYY-MM-DD
date_presetString报告时间,(如果传入time_range则忽略该字段)
fieldsList<String>查询的账户字段 eg[:’id’,’account_id’,’name’] 根据传入的字段返回相应字段值
time_incrementStringtime_increment=1是每天一条数据,time_increment=monthly是每个月一条数据,time_increment=all_days是整个时间段一条数据(不传time_increment默认就是all_days)
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <Int>,
        "message": <String>,
        "search_id": <String>
    },
    "data": [{
        "spend": <Decimal>,
        "purchase_roas": [{
            "action_type": <String>,
            "value": <String>
        }],
        …
        "date_start": <Date>,
        "date_stop": <Date>
    }]
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回的提示信息
search_idString唯一标识一个请求
dataJsonArray
spendDecimal花费金额
purchase_roasJsonArray购买广告支出的总回报率(ROAS)
action_typeString行动类型,app_custom_event
valueString数值
date_startDate开始时间
date_stopDate结束时间

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1009fields 不能为空
1010fields 参数无效
1011Facebook API 请求超时
1015缺少时间范围相关参数或参数错误
1016时间范围的开始日期不能超过当前日期的37个月
1017total_postbacks 字段只能单独查询
1024time_increment 参数无效
1025单次查询分天消耗最多不能超过N天

11、广告账户breakdowns数据

通过账号ID,时间范围,查询账号的breakdowns数据,GET请求

GET /account_insights_breakdowns  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>, 
    "breakdowns":<String>,
    "time_range":{
        "since":<String>,
        "until":<String>
    },
    "fields": List<String>, 
    "limit": <Int>,  // 最大值是200
    "sort":  <String>,  // 排序规则                   
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString广告账户ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
time_rangeObject
sinceString开始时间,YYYY-MM-DD
untilString结束时间,YYYY-MM-DD
fieldsList<String>查询的账户字段 eg[:’id’,’account_id’,’name’] 根据传入的字段返回相应字段值
limitInt最大值是200
sortString排序规则
req_headerObject
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <Int> ,
        "message": <String> ,
        "search_id": <String>
    },
    "data": [{
        "account_id": <String> ,
        "spend": <String> ,
        "country": <String> ,
        …
    }]
}
字段类型注释
resp_headerObject
codeInt
messageString
search_idString
dataJsonArray
account_idString
spendString
countryString

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1009fields 不能为空
1010fields 参数无效
1011Facebook API 请求超时
1015缺少时间范围相关参数或参数错误
1016时间范围的开始日期不能超过当前日期的37个月
1017total_postbacks 字段只能单独查询
1018缺少 breakdowns 参数或参数错误
1019sort 参数错误
1026limit最大值不能超过

12、广告账户充值状态查询

通过账号ID,查询账号的充值状态,GET请求

GET /account_recharge_status  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>, 
    "access_token": <String>,                                   
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString账号ID
req_headerObject
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <Int> ,
        "message": <String> ,
        "search_id": <String>
    },
    "data": {
        "status": <Bool> ,
        "reason": <String> 
    }
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回提示信息
search_idString唯一标识一个请求
dataObject
statusBool能否充值状态 True:可以充值, False:无法充值
reasonString无法充值原因

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1020该广告账户已被设置成违规账户
1021该广告账户的开户公司已被列入黑名单

13、账户绑定pixel

为广告账号绑定pixel

POST /account_binding_pixel  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,  
    "access_token": <String>,
    "pixel_id": <String>,                                  
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString账号ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
pixel_idStringpixel_id
req_headerObject
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header":{
        "code": <Int>,
        "message": <String>,
        "search_id" <String>:
    }
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回提示信息
search_idString唯一标识一个请求

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1011Facebook API 请求超时
1023pixel_id 不能为空

14、账户解除pixel绑定

通过账号ID,pixel ID 解除绑定关系

POST /account_remove_pixel  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,  
    "access_token": <String>,
    "pixel_id": <String>,                                  
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString账号ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
pixel_idStringpixel_id
req_headerObject
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header":{
        "code": <Int>,
        "message": <String>,
        "search_id" <String>:
    }
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回提示信息
search_idString唯一标识一个请求

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1011Facebook API 请求超时
1023pixel_id 不能为空

15、广告账户已绑定的pixel列表

通过账号ID,查询该账号已绑定的pixel列表

POST /account_pixel_list  HTTP/1.1     
Host: /api/v1/    
请求参数:    
{                    
    "id": <String>,  
    "access_token": <String>,                                
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString账号ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
req_headerObject
search_idString唯一标识一个请求

返回的结果:

{
    "resp_header": {
        "code": <Int> ,
        "message": <String> ,
        "search_id": <String>
    },
    "data": [{
        "id": <String> ,
        "name": <String> ,
    }]
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回提示信息
search_idString唯一标识一个请求
dataJsonArray
idStringpixel ID
nameStringpixel 名称

错误编码:

编码注释
1001系统异常
1002id 不能为空
1003id 参数无效
1006Facebook API 返回错误信息
1011Facebook API 请求超时

16、广告账户列表

GET /account_list  HTTP/1.1     
Host: /lb/api/v1/    
请求参数:    
{
    "access_token": <String>,
    "req_header": {
        "search_id": <String>  ​                   
    },
    "page_num":1,
    "page_size":100,
    "create_start_date":"2024-05-01",
    "create_end_date":"2024-05-31"
}
字段类型注释
access_tokenString联系开发人员获取token,token是和公司主体绑定的
req_headerObject
search_idString唯一标识一个请求
page_numInt分页查询当前页数
page_sizeInt分页查询每页数据条数(不超过500)
create_start_dateString下户起始日期
create_end_dateString下户截止日期

返回的结果:

{
    "resp_header": {
        "code": <Int> ,
        "message": <String> ,
        "search_id": <String>
    },
    "data": {
        "list": [
            {
                "id": <String> ,
                "name": <String> ,
                "created_time": <String> ,
                "status": <Int> ,
                "spend_cap": <Float> ,
                "amount_spent": <Float> ,
                "total_spend": <Float> ,
                "company_name": <String> ,
                "request_id": <String> ,
                "violation": <Bool>,
                "violation_reason": <String> ,
                "blacklist": <Int>
            }
        ],
        "total_count": 100
    }
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回提示信息
search_idString唯一标识一个请求
dataJsonArray
idString账户 ID
nameString账户名称
created_timeString下户时间
statusInt账户状态:1 正常,2 已关闭,3 封户,4 空户,7 封户-清零中
spend_capFloat花费上限
amount_spentFloat当前花费
total_spendFloat历史总花费
company_nameString开户主体(中文)
request_idString申请单编号
violationBool是否违规
violation_reasonString违规原因
blacklistInt黑名单类型:0 不在黑名单,1 今日黑名单, 2 7天惩罚期, 3 14天惩罚期, 4 永久惩罚期

错误编码:

编码注释
1001系统异常
1015缺少时间范围相关参数或参数错误
1027分页参数错误