开户审批

审批开户请求

POST /process_request  HTTP/1.1     
Host: /lb/api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>,          
    "status": <Int>,                    
    "req_header": { ​                               
        "search_id": <String>  ​                   
    }     
}
字段类型注释
idString申请单ID
access_tokenString联系开发人员获取token,token是和公司主体绑定的
statusInt1 通过,2 驳回
search_idString唯一标识一个请求

返回的结果:

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

错误编码:

编码注释
1001系统异常
1002id 不能为空
1031数据未找到
1032开户申请状态错误
1033审批状态错误
1034操作失败

获取开户申请token

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

返回的结果:

{
    "resp_header": {
        "code": 1,
        "message": "成功",
        "search_id": "234123"
    },
    "data": {
        "token": "1021248233229756"
    }
}
字段类型注释
resp_headerObject
codeInt返回的编码,1:成功
messageString返回提示信息
search_idString唯一标识一个请求
dataJsonArray
tokenString新获取的开户申请token

错误编码:

编码注释
1001系统异常
1030Facebook API 返回错误,请稍后重试
20010无效的 access_token
20015客户状态异常

广告账户列表

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下户截止日期
idString账户 ID(多个用英文逗号分隔,不超过50个)

返回的结果:

{
    "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>,
                "time_zone": <String>
            }
        ],
        "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 永久惩罚期
time_zoneString时区

错误编码:

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

广告账户已绑定的pixel列表

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

GET /account_pixel_list  HTTP/1.1     
Host: /lb/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 请求超时

账户解除pixel绑定

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

POST /account_remove_pixel  HTTP/1.1     
Host: /lb/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 不能为空

账户绑定pixel

为广告账号绑定pixel,POST请求

POST /account_binding_pixel  HTTP/1.1     
Host: /lb/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 不能为空

广告账户充值状态查询

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

GET /account_recharge_status  HTTP/1.1     
Host: /lb/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该广告账户的开户公司已被列入黑名单

广告账户breakdowns数据

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

GET /account_insights_breakdowns  HTTP/1.1     
Host: /lb/api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>, 
    "breakdowns":<String>,
    "time_range":{
        "since":<String>,
        "until":<String>
    },
    "fields": List<String>, 
    "limit": <Int>,
    "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最大值不能超过

广告账户消耗信息

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

GET /account_insights  HTTP/1.1     
Host: /lb/api/v1/    
请求参数:    
{                    
    "id": <String>,                    
    "access_token": <String>, 
    "time_range":{
        "since":<Date>,
        "until":<Date>,
    },
    "date_preset":<String>, 
    "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则忽略该字段)
enum{today, yesterday, this_month, last_month, this_quarter, maximum, data_maximum, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, last_week_mon_sun, last_week_sun_sat, last_quarter, last_year, this_week_mon_today, this_week_sun_today, this_year}
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天

广告账户信息

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

GET /account_info  HTTP/1.1     
Host: /lb/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>,
        "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 请求超时