creative

package
v0.0.0-...-80d2d60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package creative广告创意相关API models

Index

Constants

View Source
const (
	AdCategoryUnknown          = 0 // 未知广告分类
	AdCategoryPerformance      = 1 // 效果广告
	AdCategoryBrandSplash      = 2 // 品牌开屏广告
	AdCategoryBoost            = 3 // 助推广告
	AdCategoryBrandInformation = 4 // 品牌合约信息流广告
)

常量定义

View Source
const (
	MaterialTypeUnknown      = 0 // 未知类型
	MaterialTypeVertical     = 1 // 竖版
	MaterialTypeHorizontal   = 2 // 横版
	MaterialTypeSplashVideo  = 3 // 开屏视频
	MaterialTypeSplashImage  = 4 // 开屏静态图片
	MaterialTypeEyemaxSplash = 5 // eyemax类型开屏
	MaterialTypeNativeAd     = 6 // 原生广告
	MaterialTypeGalleryAd    = 7 // 图集广告
	MaterialTypeLiveDirect   = 8 // 直播直投
	MaterialTypeAIGC         = 9 // AIGC
)

素材类型常量

View Source
const (
	// 互动样式类型
	MaterialSourceMultiImage = 1 // 多图卡片
	MaterialSourceLargeImage = 2 // 大图大片
	MaterialSourceProduct    = 3 // 商品卡片
	MaterialSourceMysteryBox = 4 // 盲盒卡片

	// 行动号召目标
	CallActionPlayGame     = 1  // 玩游戏
	CallActionInstallNow   = 2  // 立即安装
	CallActionOneClick     = 3  // 一键下载
	CallActionMoreExciting = 4  // 更多精彩
	CallActionLearnMore    = 5  // 了解详情
	CallActionDownloadNow  = 6  // 立即下载
	CallActionPromotion    = 7  // 折扣促销
	CallActionOnSale       = 8  // 打折中
	CallActionGoShopping   = 9  // 去逛逛
	CallActionBuyNow       = 10 // 立即购买
)
View Source
const (
	DefaultPageNo   = 1
	DefaultPageSize = 20
)

默认分页值

View Source
const (
	OpenStatusUnknown = 0 // 未知状态
	OpenStatusOn      = 1 // 开
	OpenStatusOff     = 2 // 关
)

投放开关状态常量

View Source
const (
	CreativeStatusUnknown            = 0 // 未知投放状态
	CreativeStatusRunning            = 1 // 投放中
	CreativeStatusPaused             = 2 // 已暂停
	CreativeStatusDeleted            = 3 // 已删除
	CreativeStatusOverBudget         = 4 // 超预算
	CreativeStatusInsufficientBudget = 5 // 预算不足
	CreativeStatusUnderReview        = 6 // 审核中
	CreativeStatusRejected           = 7 // 审核拒绝
	CreativeStatusCompleted          = 8 // 投放完成
)

投放状态常量

View Source
const (
	CallToActionNone             = 0  // 无设置
	CallToActionPlayGame         = 1  // 玩游戏
	CallToActionInstallNow       = 2  // 立即安装
	CallToActionOneClickDownload = 3  // 一键下载
	CallToActionMoreExciting     = 4  // 更多精彩
	CallToActionLearnMore        = 5  // 了解详情
	CallToActionDownloadNow      = 6  // 立即下载
	CallToActionPromotion        = 7  // 折扣促销
	CallToActionOnSale           = 8  // 打折中
	CallToActionGoShopping       = 9  // 去逛逛
	CallToActionBuyNow           = 10 // 立即购买
)

行动号召目标常量

View Source
const (
	DataSourceUnknown = 0 // 未知
	DataSourceDSP     = 1 // DSP
	DataSourceMAPI    = 2 // MAPI
)

数据产生源头常量

View Source
const (
	// 广告板式类型
	CreativeTypeVideo = 1 // 视频
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatedAddCreative

type CreatedAddCreative struct {
	// 广告主账号ID
	// 标识创意所属的广告主
	AccountId int64 `json:"accountId"`

	// 创建成功的创意ID
	// 可用于后续查询或修改该创意
	CreativeId int64 `json:"creativeId"`
}

CreatedAddCreative 创建成功的创意信息

type CreatedUpdateCreative

type CreatedUpdateCreative struct {
	// 广告主账号ID
	// 标识创意所属的广告主
	AccountId int64 `json:"accountId"`

	// 修改成功的广告创意id
	CreativeId int64 `json:"creativeId"`
}

CreatedUpdateCreative 修改成功的创意信息

type CreativeAddModel

type CreativeAddModel struct {
	// 广告组ID,必填
	UnitId int64 `json:"unitId" validate:"required"`

	// 创意类型,必填,目前仅支持效果广告(1)
	// 1:效果广告
	AdCategory int `json:"adCategory" validate:"required,oneof=1"`

	// 广告板式类型,必填,目前仅支持视频(1)
	// 1:视频
	CreativeType int `json:"creativeType" validate:"required,oneof=1"`

	// 主要素材类型,必填
	// 1:竖版
	// 2:横版
	MaterialType int `json:"materialType" validate:"required,oneof=1 2"`

	// 视频ID,当creativeType=1(视频)时必填
	PhotoId *int64 `json:"photoId" validate:"required_if=CreativeType 1"`

	// 广告语,长度不超过20个字符
	SubTitle *string `json:"subTitle" validate:"omitempty,max=20"`

	// 描述,必填,长度不超过45个字符
	Desc string `json:"desc" validate:"required,max=45"`

	// 行动号召目标,必填
	// 1:玩游戏
	// 2:立即安装
	// 3:一键下载
	// 4:更多精彩
	// 5:了解详情
	// 6:立即下载
	// 7:折扣促销
	// 8:打折中
	// 9:去逛逛
	// 10:立即购买
	CallToAction int `json:"callToAction" validate:"required,oneof=1 2 3 4 5 6 7 8 9 10"`

	// 试玩广告素材ID
	PlayableId *int64 `json:"playableId"`

	// 互动样式类型,同一个创意只允许携带一种类型
	// 1:多图卡片
	// 2:大图大片
	// 3:商品卡片
	// 4:盲盒卡片
	MaterialSourceType *int `json:"materialSourceType" validate:"omitempty,oneof=1 2 3 4"`

	// 互动样式ID集合,当materialSourceType设置时必填,不超过3个
	MaterialIdList []int64 `json:"materialIdList" validate:"omitempty,max=3,required_if=MaterialSourceType 1 2 3 4"`

	// 创意名称,必填,长度不超过100个字符
	CreativeName string `json:"creativeName" validate:"required,max=100"`

	// 是否使用应用图标和名称
	// 仅当广告计划的marketingType=1(应用推广)时有效
	UseUnitAppIconAndName *bool `json:"useUnitAppIconAndName"`

	// 头像ID,当useUnitAppIconAndName不为true时必填
	// 包含创意来源和头像-标题、创意来源和头像-创意头像两部分
	AvatarId *int64 `json:"avatarId" validate:"required_unless=UseUnitAppIconAndName true"`

	// 深度转换链接(Deep Link)
	DeepLink *string `json:"deepLink"`

	// 新增字段:广告身份。原生广告必填
	// 2:原生账号
	OrganicIdentityType *int `json:"organicIdentityType" validate:"omitempty,oneof=2"`

	// 新增字段:原生广告账户id。原生广告必填
	ProfileAccountId *int64 `json:"profileAccountId" validate:"required_with=OrganicIdentityType"`

	// 新增字段:素材库上传成功后获得的key。在「素材库视频->上传原生视频->创建creative」流程必传
	PostKey *string `json:"postKey" validate:"required_with=ProfileAccountId"`

	// 新增字段:原生视频id。在「查询原生视频->创建广告创意」流程必传
	PostPhotoId *int64 `json:"postPhotoId" validate:"required_with=ProfileAccountId"`
}

CreativeAddModel 单个创意添加模型

type CreativeAddRequest

type CreativeAddRequest struct {
	// 账户ID,必填
	AccountId int64 `json:"accountId" validate:"required"`

	// 创意添加模型列表,单次上限15个,同时遵循单个广告组下上限15个
	// 每个元素代表一个要添加的创意
	CreativeAddModelList []CreativeAddModel `json:"creativeAddModelList" validate:"required,max=15,dive"`
}

CreativeAddRequest 广告创意添加请求

func (CreativeAddRequest) Encode

func (r CreativeAddRequest) Encode() []byte

Encode implement PostRequest interface

func (CreativeAddRequest) Url

func (r CreativeAddRequest) Url() string

Url implement PostRequest interface

func (*CreativeAddRequest) Validate

func (r *CreativeAddRequest) Validate() error

Validate 自定义验证方法

type CreativeAddResponse

type CreativeAddResponse struct {
	// 数据总行数
	// 表示本次操作影响的创意总数
	Total int `json:"total"`

	// 数据明细
	// 包含每个成功创建的创意信息
	Data []*CreatedAddCreative `json:"data"`
}

CreativeAddResponse 响应数据

type CreativeDeleteRequest

type CreativeDeleteRequest struct {
	// 账户ID,必填
	AccountId int64 `json:"accountId" validate:"required"`

	// 创意更新模型列表,目前只支持单个对象
	CreativeIdList []int64 `json:"creativeIdList" validate:"required,len=1,dive"`
}

CreativeDeleteRequest 广告创意更新请求

func (CreativeDeleteRequest) Encode

func (r CreativeDeleteRequest) Encode() []byte

Encode implement PostRequest interface

func (CreativeDeleteRequest) Url

func (r CreativeDeleteRequest) Url() string

Url implement PostRequest interface

type CreativeDeleteResponse

type CreativeDeleteResponse struct {
	// 数据总行数
	// 表示本次操作影响的创意总数
	Total int `json:"total"`

	// 数据明细
	// 删除成功的广告创意id集合
	Data []int64 `json:"successIdList"`
}

CreativeDeleteResponse 响应数据

type CreativeListRequest

type CreativeListRequest struct {
	AccountId      int64   `json:"accountId"`      // 账户ID,必填
	AdCategory     int     `json:"adCategory"`     // 广告分类,必填
	CampaignIdList []int64 `json:"campaignIdList"` // 广告计划ID列表,不超过100个
	UnitIdList     []int64 `json:"unitIdList"`     // 广告组ID列表,不超过100个
	CreativeIdList []int64 `json:"creativeIdList"` // 广告创意ID列表,不超过100个
	Status         *int    `json:"status"`         // 投放状态(使用指针表示可选字段)
	PageNo         int     `json:"pageNo"`         // 请求页码,默认1
	PageSize       int     `json:"pageSize"`       // 每页行数,默认20
}

CreativeListRequest 广告创意列表请求参数

func (CreativeListRequest) Encode

func (r CreativeListRequest) Encode() []byte

Encode implement PostRequest interface

func (CreativeListRequest) Url

func (r CreativeListRequest) Url() string

Url implement PostRequest interface

func (*CreativeListRequest) Validate

func (r *CreativeListRequest) Validate() error

Validate 请求参数验证

type CreativeListResponse

type CreativeListResponse struct {
	Total int             `json:"total"` // 数据总行数
	Data  []*ListCreative `json:"data"`  // 数据明细
}

CreativeListResponse 创意列表数据

type CreativeReviewItem

type CreativeReviewItem struct {
	AccountId        int64    `json:"accountId"`        // 广告主账号id
	CreativeId       int64    `json:"creativeId"`       // 广告创意id
	ReviewStatus     int      `json:"reviewStatus"`     // 审核状态
	ReviewDetailList []string `json:"reviewDetailList"` // 审核建议集合
}

CreativeReviewItem 单个创意审核结果

type CreativeReviewRequest

type CreativeReviewRequest struct {
	AccountId      int64   `json:"accountId" validate:"required"`              // 账户ID,必填
	CreativeIdList []int64 `json:"creativeIdList" validate:"required,max=100"` // 广告创意ID列表,必填,不超过100个
	Language       int     `json:"language"`                                   // 语言选择,默认0
}

广告创意-获取审核建议:

func (CreativeReviewRequest) Encode

func (r CreativeReviewRequest) Encode() []byte

Encode implement PostRequest interface

func (CreativeReviewRequest) Url

func (r CreativeReviewRequest) Url() string

Url implement PostRequest interface

type CreativeReviewResponse

type CreativeReviewResponse struct {
	Total int                   `json:"total"` // 数据总行数
	Data  []*CreativeReviewItem `json:"data"`  // 数据明细
}

CreativeReviewResponse 审核数据容器

type CreativeUpdateModel

type CreativeUpdateModel struct {
	// 广告创意ID,必填
	CreativeId int64 `json:"creativeId" validate:"required"`

	// 视频ID,更新视频素材时使用
	// 如果不需要更新视频素材,可以设置为nil
	PhotoId *int64 `json:"photoId"`

	// 广告语,长度不超过20个字符
	// 空字符串表示不更新,nil表示删除原有广告语
	SubTitle *string `json:"subTitle" validate:"omitempty,max=20"`

	// 描述,长度不超过45个字符
	// 空字符串表示不更新,nil表示删除原有描述
	Desc *string `json:"desc" validate:"omitempty,max=45"`

	// 行动号召目标
	// 1:玩游戏
	// 2:立即安装
	// 3:一键下载
	// 4:更多精彩
	// 5:了解详情
	// 6:立即下载
	// 7:折扣促销
	// 8:打折中
	// 9:去逛逛
	// 10:立即购买
	CallToAction *int `json:"callToAction" validate:"omitempty,oneof=1 2 3 4 5 6 7 8 9 10"`

	// 试玩ID,0表示删除原本绑定的试玩广告素材
	PlayableId *int64 `json:"playableId"`

	// 互动样式类型
	// 1:多图卡片
	// 2:大图大片
	// 3:商品卡片
	// 4:盲盒卡片
	// 若修改,需要重新传递materialIdList
	MaterialSourceType *int `json:"materialSourceType" validate:"omitempty,oneof=1 2 3 4"`

	// 互动样式ID集合,不超过3个
	// 空数组[]表示删除原本绑定的互动样式素材
	MaterialIdList []int64 `json:"materialIdList" validate:"omitempty,max=3"`

	// 创意名称,长度不超过100个字符
	CreativeName *string `json:"creativeName" validate:"omitempty,max=100"`

	// 是否复用广告组的App应用的图标和应用名
	// 仅广告计划的"选择平台"为"应用推广"时有效
	// 改为false时"头像id"(avatarId)必填
	UseUnitAppIconAndName *bool `json:"useUnitAppIconAndName"`

	// 头像ID
	// 当useUnitAppIconAndName=false时必填
	AvatarId *int64 `json:"avatarId" validate:"required_if=UseUnitAppIconAndName false"`

	// 深度转换链接(Deep Link)
	DeepLink *string `json:"deepLink"`
	// 新增字段:广告身份。原生广告必填
	// 2:原生账号
	OrganicIdentityType *int `json:"organicIdentityType" validate:"omitempty,oneof=2"`

	// 新增字段:原生广告账户id。原生广告必填
	ProfileAccountId *int64 `json:"profileAccountId" validate:"required_with=OrganicIdentityType"`

	// 新增字段:素材库上传成功后获得的key。在「素材库视频->上传原生视频->创建creative」流程必传
	PostKey *string `json:"postKey" validate:"required_with=ProfileAccountId"`

	// 新增字段:原生视频id。在「查询原生视频->创建广告创意」流程必传
	PostPhotoId *int64 `json:"postPhotoId" validate:"required_with=ProfileAccountId"`
}

CreativeUpdateModel 单个创意更新模型

type CreativeUpdateRequest

type CreativeUpdateRequest struct {
	// 账户ID,必填
	AccountId int64 `json:"accountId" validate:"required"`

	// 创意更新模型列表,目前只支持单个对象
	CreativeUpdateModelList []CreativeUpdateModel `json:"creativeUpdateModelList" validate:"required,len=1,dive"`
}

CreativeUpdateRequest 广告创意更新请求

func (CreativeUpdateRequest) Encode

func (r CreativeUpdateRequest) Encode() []byte

Encode implement PostRequest interface

func (CreativeUpdateRequest) Url

func (r CreativeUpdateRequest) Url() string

Url implement PostRequest interface

func (*CreativeUpdateRequest) Validate

func (r *CreativeUpdateRequest) Validate() error

Validate 自定义验证方法

type CreativeUpdateResponse

type CreativeUpdateResponse struct {
	// 数据总行数
	// 表示本次操作影响的创意总数
	Total int `json:"total"`

	// 数据明细
	// 包含每个成功创建的创意信息
	Data []*CreatedUpdateCreative `json:"data"`
}

CreativeUpdateResponse 响应数据

type ListCreative

type ListCreative struct {
	AccountId            int64   `json:"accountId"`            // 广告主账号id
	CampaignId           int64   `json:"campaignId"`           // 广告计划id
	UnitId               int64   `json:"unitId"`               // 广告组id
	CreativeId           int64   `json:"creativeId"`           // 广告创意id
	CreativeName         string  `json:"creativeName"`         // 广告创意名称
	AdCategory           int     `json:"adCategory"`           // 广告分类
	OpenStatus           int     `json:"openStatus"`           // 投放开关状态
	Status               int     `json:"status"`               // 投放状态
	MaterialType         int     `json:"materialType"`         // 主要素材类型
	DeepLink             string  `json:"deepLink"`             // 深度转换链接
	PhotoId              int64   `json:"photoId"`              // 视频id
	SubTitle             string  `json:"subTitle"`             // 广告语
	Desc                 string  `json:"desc"`                 // 描述
	CallToAction         int     `json:"callToAction"`         // 行动号召目标
	PlayableId           int64   `json:"playableId"`           // 试玩广告素材id
	MaterialIdList       []int64 `json:"materialIdList"`       // 互动样式素材id集合
	AdvertiserName       string  `json:"advertiserName"`       // 创意来源和头像-标题
	AvatarId             int64   `json:"avatarId"`             // 创意来源和头像-头像id
	ImpressionUrl        string  `json:"impressionUrl"`        // 第三方曝光监测链接
	ClickUrl             string  `json:"clickUrl"`             // 第三方点击监测链接
	DataGenerationSource int     `json:"dataGenerationSource"` // 数据产生源头
	CreateTime           int64   `json:"createTime"`           // 创建时间
	UpdateTime           int64   `json:"updateTime"`           // 更新时间
}

ListCreative 广告创意详情

type Material

type Material struct {
	// PhotoID 视频ID
	PhotoID string `json:"photo_id,omitempty"`
	// ImageTokens 封面图片token
	ImageTokens []string `json:"image_tokens,omitempty"`
	// CreativeMaterialType 素材类型
	CreativeMaterialType int `json:"creative_material_type,omitempty"`
	// StickerTitles 封面广告语
	StickerTitles []string `json:"sticker_titles,omitempty"`
}

Material 物料信息

type Photo

type Photo struct {
	// PhotoID 视频ID
	PhotoID uint64 `json:"photo_id,omitempty"`
	// CoverImageToken 封面图片token;通过上传图片接口获得,不传值则直接使用视频的首帧作为封面图片,自定义封面的图片宽高要与视频宽高一致,使用智能抽帧时不需要传递。
	CoverImageToken string `json:"cover_image_token,omitempty"`
	// CreativeMaterialType 素材类型; 1:竖版视频 2:横版视频
	CreativeMaterialType int `json:"creative_material_type,omitempty"`
}

Photo 新创建程序化创意请使用素材列表

type ProgrammedCreativeMaterial

type ProgrammedCreativeMaterial struct {
	// Materials 物料信息
	Materials []Material `json:"materials,omitempty"`
	// StickerStyleIDs 封面贴纸类型ID
	StickerStyleIDs []int `json:"sticker_style_ids,omitempty"`
	// DescriptionTItles 广告语
	DescriptionTItles []string `json:"description_titles,omitempty"`
	// StickerTitles 封面广告语
	StickerTitles []string `json:"sticker_titles,omitempty"`
}

ProgrammedCreativeMaterial 程序化创意物料

type UpdateStatusRequest

type UpdateStatusRequest struct {
	// 账户ID,必填
	AccountId int64 `json:"accountId"`
	// CreativeIDs 与原有的creative_id字段可以同时填,也可以只填一个; 1.传入的创意id不得重复,且至少有一个;传入的创意id总数最多20个。2.put_status为3时,会删除所有创意
	CreativeIDs []uint64 `json:"creativeIdList"`
	// 投放开关状态,必填; 1-投放、2-暂停 传其他数字非法
	OpenStatus int `json:"openStatus"`
}

UpdateStatusRequest 修改创意状态

func (UpdateStatusRequest) Encode

func (r UpdateStatusRequest) Encode() []byte

Encode implement PostRequest interface

func (UpdateStatusRequest) Url

func (r UpdateStatusRequest) Url() string

Url implement PostRequest interface

type UpdateStatusResponse

type UpdateStatusResponse struct {
	// 数据总行数
	// 表示本次操作影响的创意总数
	Total int `json:"total"`

	// 数据明细
	// 投放状态修改成功的广告创意id集合
	SuccessIdList []int64 `json:"successIdList"`
}

UpdateStatusResponse 响应数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL