Skip to content

更新预算

需要携带 Token,详情看 Token

更新广告单元预算。

1、支持针对广告单元或者广告单元里的不同地区设置预算,一个广告单元里只能选择一种预算设置类型
2、针对广告单元设置预算,将 country_code 设置为"ALL"即可,表示广告单元里所有地区共享一个预算
3、针对广告单元里不同地区设置预算,需要将 country_code 设置为特定地区的缩写,如"CN,US",共享同一预算的地区写在一组 country_code 里即可。(注:仅能针对广告单元的投放地区设置预算,所有投放地区均需设置预算,另,不同预算组之间的 country_code 必须互斥,不可存在交集)

请求地址

https://ss-api.mintegral.com/api/open/v1/offer/budget

请求方法

PUT

请求示例

json
PUT /api/open/v1/offer/budget
HTTP/1.1 Host: ss-api.mintegral.com
Content-Type: application/json
{
  "offer_id": 123,
  "budget": [
    {
      "country_code": "US",
      "daily_cap_type": "BUDGET",
      "daily_cap": 0,
      "total_budget": "OPEN",
      "total_budget_effective_time": "2019-10-10",
      "total_budget_effective_timezone": 5.5
    },
    {
      "country_code": "CN",
      "daily_cap_type": "BUDGET",
      "daily_cap": 0,
      "total_budget": "OPEN",
      "total_budget_effective_time": "2019-10-10",
      "total_budget_effective_timezone": 8
    }
  ]
}

请求参数

字段类型说明默认值例子
offer_idint广告单元 ID123
budgetarray预算配置
country_codestring设置预算的地区,多个用,隔开"CN,EN"
daily_cap_typestring每日预算类型,可选值:
"BUDGET""CONVERSION"
"BUDGET"
daily_capint每日预算,最小值 50
total_budgetstring / int指定时间范围内可消耗的总预算."OPEN"表示不设预算。"OPEN"
total_budget_effective_timestring预算生效时间,格式:年-月-日"2019-05-09"
total_budget_effective_timezonenumber时区,可选值:[枚举值 - 时区]5.5

响应结果

字段类型说明
codeint200 表示成功 其他表示失败
msgstring成功,返回"success",失败返回相应的错误信息
datajson如果失败,返回具体的错误信息

应答示例

json
{
  "msg": "success",
  "code": 200,
  "data": {}
}

错误码信息

注:错误信息格式如下:

json
{
  "code": 10000,
  "msg": "error",
  "data": {
    "budget": "The budget field is required."
  }
}

错误码列表如下:

codemsgdata说明
10000error
{
    "budget": "The budget field is required."
}
budget字段不能为空
10000error
{
    "budget": "budget is not json string!"
}
budget字段必须为Json字符串
11423budget is error!
{
    "country_code": "you can only set ALL budget
    or special budget!"
}
设置广告单元预算时,预算类型仅能选择all(广告单元中的所有地区共享一个预算)、specifical budget(针对不同地区设置不同预算)中的任一,不可同时设置。
11423budget is error!
{
    "country_code": "KB cannot set budget, you can only 
    set budget on ALL or special country(AD,AE,AF,CN)!"
}
设置special budget时,仅可以设置location范围内的国家。
11423budget is error!
{
    "budget": "these (AD,AE,AF,CN) not set budget!"
}
设置special budget时,location范围内的国家必须全部设置,并且每个国家只能设置一次。
11423budget is error!
{
    "daily_cap_type": "daily_cap_type must be
    BUDGET or CONVERSION!"
}
daily_cap_type字段必须为"BUDGET"或者"CONVERSION"
11423budget is error!
{
    "daily_cap": "daily_cap is empty!"
}
daily_cap字段不能为空
11423budget is error!
{
    "total_budget": "total_budget is empty!"
}
total_budget字段不能为空
11423budget is error!
{
    "daily_cap": "daily_cap cannot less than 50!"
}
daily_cap不能小于50
当daily_cap非"OPEN"或者小于50报错
11423budget is error!
{
    "total_budget_effective_time": 
    "total_budget_effective_time is empty!"
}
total_budget_effective_time字段不能为空
11423budget is error!
{
    "total_budget_effective_timezone": 
    "total_budget_effective_timezone is empty!"
}
total_budget_effective_timezone字段不能为空
11423budget is error!
{
    "total_budget_effective_time": 
    "total_budget_effective_time is error(Ex:2019-01-01)!"
}
total_budget_effective_time格式错误,格式必须为yyyy-mm-dd
11423budget is error!
{
    "total_budget_effective_timezone": 
    "total_budget_effective_timezone is error, 
    total_budget_effective_timezone must be 
    -11 or -10 or -9 or -8 or -7 or -6 or -5 or
    -4 or -3 or -2 or -1 or 0 or 1 or 2 or 3 or 
    4 or 5 or 5.5 or 6 or 7 or 8 or 9 or 10 or 11!"
}
total_budget_effective_timezone字段错误,必须为 [枚举值 - 时区] 之一