百度信息流推广API

    闪投单元模块主要接口

    查询闪投推广单元

    接口描述

    查询闪投推广单元信息,每次查询最多100个。

    接口URL

    http://sem.baidubce.com/v1/feed/cloud/DpaAdgroupFeedService/getAdgroupFeed

    请求参数说明

    字段名称 类型 描述
    adgroupFeedFields array(string) 需要查询的单元属性,属性名称即闪投推广单元对象的字段名称。
    idType number 查询条件ids字段的类型,1表示计划ID,2表示单元ID。
    ids array(number) 需要查询的计划ID/单元ID数组,最多填100个ID。

    响应参数说明

    响应对象为闪投推广单元对象数组,包含‘adgroupFeedFields’查询属性的字段信息,请参考其字段定义。

    请求示例

    POST /v1/feed/cloud/DpaAdgroupFeedService/getAdgroupFeed HTTP/1.1
    Accept-encoding: 'gzip, deflate'
    Host: sem.baidubce.com
    ContentType: application/json
    Authorization: bce-auth-v1/b406c344bb764e00aff7d3b80d9bd87a/2019-06-05T07:34:31Z/1800/host/bb0f820e4499b8b44548388b37a7afed970e965a7a59f79ebac47a99c315a97b(签名有效时间为30分钟,需要替换成自己生成的签名)
    Accept: '*/*'
    {
    	"header": {
    		"opUsername": "example",
    		"tgUsername": "example",
    		"bceUser": "example",
    		"opPassword": "example",
    		"tgPassword": "example"
    	},
    	"body": {
    		"ids": [
    			2205036260, 2205036555, 2223322211
    		],
    		"idType": 2,
    		"adgroupFeedFields": [
    			"campaignFeedId", "adgroupFeedId", "adgroupFeedName", "bid", "status", "pause", "ftypes", "producttypes", "productSetId", "bidtype", "ocpc",
    			"paCrowd", "premium", "paKeywords", "interests", "age", "sex", "education", "device", "net", "region", "mediaCategoriesBindType", "mediaCategories", "mediaidsBindType", "mediaids", "mediaPackage", "unitProducts"
    		]
    	}
    }

    响应示例

    {
        "body":{
            "data":[
                {
                    "bidtype": 1,
                    "campaignFeedId": 87725167,
                    "audience": {
                        "autoRegion": "0",
                        "education": "0",
                        "paKeywords": null,
                        "premium": "{\"common\":true}",
                        "sex": "0",
                        "paCrowd": null,
                        "interests": null,
                        "net": "0",
                        "region": "1000,2000",
                        "device": "0",
                        "age": "0",
                        "mediaids": "",
                        "mediaidsBindType": "0",
                        "mediaCategoriesBindType": "1",
                        "mediaCategories": "21",
                        "mediaPackage": ""
                    },
                    "ocpc": null,
                    "unitProducts": {
                        "catalogId": 10023,
                        "ruleProducts": [
                            {
                                "field": "category",
                                "operation": "EQUAL",
                                "value": "电脑、办公"
                            }
                        ]
                    },
                    "adgroupFeedId": 2205036260,
                    "productSetId": 6270,
                    "producttypes": [
                        1,
                        2
                    ],
                    "ftypes": [],
                    "bid": 1,
                    "adgroupFeedName": "闪投_目录01",
                    "pause": false,
                    "status": 0
                },
                {
                    "bidtype": 1,
                    "campaignFeedId": 87725167,
                    "audience": {
                        "education": "0",
                        "paKeywords": "{\"showWords\":[{\"showword\":\"博瑞最新优惠\",\"type\":1},{\"showword\":\"${name}\",\"type\":2},{\"showword\":\"大众宝来\",\"type\":1},{\"showword\":\"${sellerName}${name}\",\"type\":2},{\"showword\":\"${brand}价格\",\"type\":2},{\"showword\":\"${brand}${category}\",\"type\":2},{\"showword\":\"${brand}怎么样\",\"type\":2},{\"showword\":\"${name}好不好\",\"type\":2},{\"showword\":\"${city}\",\"type\":2},{\"showword\":\"途观降价\",\"type\":1},{\"showword\":\"${brand}好不好\",\"type\":2},{\"showword\":\"${name}去哪买\",\"type\":2},{\"showword\":\"${brand}\",\"type\":2},{\"showword\":\"买${name}\",\"type\":2},{\"showword\":\"${category}\",\"type\":2},{\"showword\":\"${sellerName}${category}\",\"type\":2}],\"keywordsExtend\":\"1\",\"ktFilter\":false,\"autoMatch\":true}",
                        "premium": null,
                        "sex": "0",
                        "paCrowd": null,
                        "interests": null,
                        "net": "0",
                        "region": "9999999",
                        "device": "0",
                        "age": "0"
                    },
                    "ocpc": null,
                    "adgroupFeedId": 2205036555,
                    "productSetId": 5701,
                    "producttypes": [
                        1,
                        2
                    ],
                    "ftypes": [],
                    "bid": 1,
                    "adgroupFeedName": "闪投_前kg03",
                    "pause": false,
                    "status": 0
                }
            ]
        },
        "header":{
            "oprs":3,
            "failures":[
                {
                    "code":500002,
                    "message":"单元不存在",
                    "position":"2",
                    "content":null
                }
            ],
            "succ":2,
            "oprtime":0,
            "desc":"partial success",
            "status":1
        }
    }

    新建闪投推广单元

    接口描述

    新建闪投推广单元,每次新建最多100个。

    接口URL

    http://sem.baidubce.com/v1/feed/cloud/DpaAdgroupFeedService/addAdgroupFeed

    请求参数说明

    字段名称 类型 描述
    adgroupFeedTypes array(object) 闪投推广单元对象数组,请参考其定义。

    响应参数说明

    响应对象为闪投推广单元对象数组,但是仅仅包含新增单元的campaignFeedIdadgroupFeedIdadgroupFeedName,请参考其字段定义。

    请求示例

    POST /v1/feed/cloud/DpaAdgroupFeedService/addAdgroupFeed HTTP/1.1
    Accept-encoding: 'gzip, deflate'
    Host: sem.baidubce.com
    ContentType: application/json
    Authorization: bce-auth-v1/b406c344bb764e00aff7d3b80d9bd87a/2019-06-05T07:34:31Z/1800/host/bb0f820e4499b8b44548388b37a7afed970e965a7a59f79ebac47a99c315a97b(签名有效时间为30分钟,需要替换成自己生成的签名)
    Accept: '*/*'
    {
    	"header": {
    		"opUsername": "example",
    		"tgUsername": "example",
    		"bceUser": "example",
    		"opPassword": "example",
    		"tgPassword": "example"
    	},
    	"body": {
        "adgroupFeedTypes": [
                      {
                    "bidtype": 1,
                    "campaignFeedId": 87725167,
                    "audience": {
                        "autoRegion": "1",
                        "education": "0",
                        "paKeywords": null,
                        "premium": "{\"common\":true}",
                        "sex": "0",
                        "paCrowd": "{\"basic\":[],\"common\":[],\"exclude\":[54320287489,54320287484]}",
                        "interests": null,
                        "net": "0",
                        "region": "9999999",
                        "device": "0",
                        "age": "0"
                    },
                    "ocpc": null,
                    "unitProducts": {
                        "catalogId": 10023,
                        "ruleProducts": [
                            {
                                "field": "category",
                                "operation": "EQUAL",
                                "value": "电脑、办公"
                            }
                        ]
                    },
                    "adgroupFeedId": 2205044058,
                    "productSetId": 6431, // unitProducts有效时,可以不设置productSetId
                    "producttypes": [
                        1,
                        2
                    ],
                    "ftypes": [],
                    "bid": 1,
                    "adgroupFeedName": "闪投_人群_02",
                    "pause": false,
                    "status": 0
                }
        ]
    	}
    }

    响应示例

    {
    	"body": {
    		"data": [{
    			"campaignFeedId": 87725167,
    			"adgroupFeedId": 2205044064,
    			"adgroupFeedName": "闪投_人群_02"
    		}]
    	},
    	"header": {
    		"oprs": 1,
    		"failures": [
    
    		],
    		"succ": 1,
    		"oprtime": 0,
    		"desc": "success",
    		"status": 0
    	}
    }

    更新闪投推广单元

    接口描述

    更新闪投推广单元,每次更新最多100个。

    接口URL

    http://sem.baidubce.com/v1/feed/cloud/DpaAdgroupFeedService/updateAdgroupFeed

    请求参数说明

    字段名称 类型 描述
    adgroupFeedTypes array(object) 闪投推广单元对象数组,请参考其定义。

    响应参数说明

    响应对象为闪投推广单元对象数组,但是仅仅包含更新单元的campaignFeedIdadgroupFeedIdadgroupFeedName,请参考其字段定义。

    请求示例

    POST /v1/feed/cloud/DpaAdgroupFeedService/updateAdgroupFeed HTTP/1.1
    Accept-encoding: 'gzip, deflate'
    Host: sem.baidubce.com
    ContentType: application/json
    Authorization: bce-auth-v1/b406c344bb764e00aff7d3b80d9bd87a/2019-06-05T07:34:31Z/1800/host/bb0f820e4499b8b44548388b37a7afed970e965a7a59f79ebac47a99c315a97b(签名有效时间为30分钟,需要替换成自己生成的签名)
    Accept: '*/*'
    {
    	"header": {
    		"opUsername": "example",
    		"tgUsername": "example",
    		"bceUser": "example",
    		"opPassword": "example",
    		"tgPassword": "example"
    	},
    	"body": {
    		"adgroupFeedTypes": [{
    			"bidtype": 1,
    			"campaignFeedId": 87725167,
    			"adgroupFeedId": 2205044064,
    			"audience": {
                    "autoRegion": "0",
    				"education": "1,2",
    				"paKeywords": null,
    				"premium": "{\"common\":true}",
    				"sex": "1",
    				"paCrowd": "{\"basic\":[],\"common\":[],\"exclude\":[54320287489]}",
    				"interests": null,
    				"net": "1",
    				"region": "1000,3000",
    				"device": "1",
    				"age": "1,2"
    			},
    			"ocpc": null,
          "unitProducts": {
            "catalogId": 10023,
            "ruleProducts": [
              {
                "field": "category",
                "operation": "EQUAL",
                "value": "电脑、办公"
              }
            ]
          },
    			"productSetId": 6431,
    			"producttypes": [
    				1,
    				2
    			],
    			"ftypes": [],
    			"bid": 1,
    			"adgroupFeedName": "闪投_人群_02",
    			"pause": false,
    			"status": 0
    		}]
    	}
    }

    响应示例

    {
    	"body": {
    		"data": [{
    			"campaignFeedId": 87725167,
    			"adgroupFeedId": 2205044064,
    			"adgroupFeedName": "闪投_人群_02"
    		}]
    	},
    	"header": {
    		"oprs": 1,
    		"failures": [
    
    		],
    		"succ": 1,
    		"oprtime": 0,
    		"desc": "success",
    		"status": 0
    	}
    }

    删除闪投推广单元

    接口描述

    删除闪投推广单元,每次删除最多100个。删除推广单元,同时删除单元下所有从属信息,例如:意图词表、定向设置、慧图配置、及创意信息等。 注意: 删除后不可恢复,请谨慎操作。

    接口URL

    http://sem.baidubce.com/v1/feed/cloud/DpaAdgroupFeedService/deleteAdgroupFeed

    请求参数说明

    字段名称 类型 描述
    adgroupFeedIds array(number) 待删除的单元ID,一次最多删除100个单元。

    响应参数说明

    响应对象为闪投推广单元对象数组,但是仅仅包含被删除的单元ID信息,请参考其字段定义。

    请求示例

    POST /v1/feed/cloud/DpaAdgroupFeedService/deleteAdgroupFeed HTTP/1.1
    Accept-encoding: 'gzip, deflate'
    Host: sem.baidubce.com
    ContentType: application/json
    Authorization: bce-auth-v1/b406c344bb764e00aff7d3b80d9bd87a/2019-06-05T07:34:31Z/1800/host/bb0f820e4499b8b44548388b37a7afed970e965a7a59f79ebac47a99c315a97b(签名有效时间为30分钟,需要替换成自己生成的签名)
    Accept: '*/*'
    {
    	"header": {
    		"opUsername": "example",
    		"tgUsername": "example",
    		"bceUser": "example",
    		"opPassword": "example",
    		"tgPassword": "example"
    	},
    	"body": {
    		"adgroupFeedIds": [
    			2204935234
    		]
    	}
    }

    响应示例

    {
        "body":{
            "data":[
    
            ]
        },
        "header":{
            "oprs":1,
            "failures":[
    
            ],
            "succ":1,
            "oprtime":0,
            "desc":"success",
            "status":0
        }
    }
    上一篇
    闪投推广单元对象
    下一篇
    推广单元模块-附录