当前位置:网站首页>Vivo market API event reporting and docking
Vivo market API event reporting and docking
2022-07-29 04:53:00 【BIG_ PEI】
1. Create data source for advertising account
2. Developer account creation App application redirectUrl And authorized url Agreement
2. Get authorization access_token
The address of the authorization page is https://open-ad.vivo.com.cn/OAuth?clientId={ Your client_id}&state={ Developer logo }&redirectUri={ Your redirectUri}
Be careful :
client_id Application created by developer account clientid
redirectUri( token url ) The domain name should be the same as that filled in when applying for application redirectUri The domain name is the same ;
state Required ( There is no limit to the content ) for example : Authorized marketing platform account name or account ID.
3.get Request the authorization page address to give the data upload permission to the release account here code and state Will pass redirecturl Save to advertiser database
4、 The application program calls the interface with the authorization code (Authorization Code) get access_token, At the same time, get one for refresh access_token Of refresh_token; For details, please refer to Access Token;
obtain Access Token
Request address
https://marketing-api.vivo.com.cn/openapi/v1/oauth2/token
Request method
Get
public String getToken(String clientId,String secret,String code) {
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder().url("https://marketing-api.vivo.com.cn/openapi/v1/oauth2/token?client_id="+clientId+"&client_secret="+secret+"&grant_type=code&code="+code)
.method("GET", null)
.build();
Response response = client.newCall(request).execute();
return response.body().string();
}
Parameter interpretation :
client_id application id, After creating an application on the developer's official website , You can use the application list see
client_secret Application key Created by developers App Application acquisition
grant_type obtain token The way , The current fixed value is code, Express basis authorization_code get
code Obtained when binding the application authorization_code value Save to database code value
5. User behavior data upload
Request address
https://marketing-api.vivo.com.cn/openapi/v1/advertiser/behavior/upload
public String send() {
String url = "https://marketing-api.vivo.com.cn/openapi/v1/advertiser/behavior/upload";
String advertiserId = "X";
String nonce = "XX";
String accessToken = "XXX";
String timestamp = "XXXX";
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
String jsonStr = "XX"; // Using request parameters json String replacement , The format is shown in the following example
RequestBody body = RequestBody.create(mediaType, jsonStr);
Request request = new Request.Builder()
.url(url + "?access_token=" + accessToken + "×tamp=" + timestamp + "&nonce=" + nonce + "&advertiser_id=" + advertiserId)
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
return response.body().string();
}{
"dataList": [{
"creativeId": "CreativeId_0000000000000",
"cvParam": "param1:value1,param2:value2",
"cvTime": 1568617282000,
"cvType": "ACTIVATION",
"userId":"oaidKSByShAaVlpqwWbECdNVqKVJAcTtCOrKGXisGyJQXqcQgIwNoGpZwAjpDUWt",
"dlrSrc": "DlrSrc0",
"userIdType": "oaid",
"requestId": "RequestId_111111111111122",
"CvCustom": "ddddddddd"
}
],
"pageUrl": "abc",
"pkgName": "com.vivo.sen2",
"srcId": "ds-201909120272",
"srcType": "app"
} Be careful
post request url Several parameters are required on the path
userId by oaid Time can only be vivo Of oaid Otherwise, it will prompt oaid error \
access_token authorization token , complete OAuth 2.0 To obtain after authorization , Reference resources Oauth2.0 to grant authorization - Authorization process chapter .
With Query Parameter Mode is passed in the request path .
nonce
Random string identification , No more than 32 Characters , Generated by the caller , Ensure global uniqueness .
With Query Parameter Mode is passed in the request path .( Each string can only be used once )
timestamp The current timestamp , The unit is millisecond , The maximum time error allowed for client requests is 600 second .MarketingAPI Timestamp used , Unless otherwise specified , All are millisecond timestamps .MarketingAPI The time zone used is GMT+8, For example, when the timestamp is 1598451101338 when , Express 2020-08-26 22:11:41
With Query Parameter Mode is passed in the request path .
advertiser_id Account ID.
If the authorized account number is a second-generation account , You need to fill in the corresponding release account to be operated id( It can be obtained by querying the second generation subordinate advertiser interface , take UUID Field );
If the authorized account is the advertiser's delivery account, you can leave it blank ;
With Query Parameter Mode is passed in the request path .
After the request is successful You can view it in the release account data source App Corresponding event of
边栏推荐
- Box horizontal vertical center layout (summary)
- Recyclerview switches the focus up and down through the dpad key. When switching to the control outside the interface, the focus will jump left and right
- Recommendation system of online education
- excel怎么设置行高和列宽?excel设置行高和列宽的方法
- Common current limiting methods
- Reveal installation configuration debugging
- 命令行交互工具(最新版) inquirer 实用教程
- iOS面试准备 - ios篇
- [c language] use the reverse order output of the linked list (bidirectional linked list)
- Learn matlab to draw geographical map, line scatter bubble density map
猜你喜欢

Deep analysis of data storage in memory (Advanced C language)

un7.28:redis客户端常用命令。

WPS如何进行快速截屏?WPS快速截屏的方法

Mysql各版本下载地址及多版本共存安装

On prepayment of house purchase

怎样监测微型的网站服务

Correct user dragging method

Flutter 手势监听和画板实现

Classes and objects (III)

Command line interactive tools (latest version) inquirer practical tutorial
随机推荐
PHP判断用户是否已经登录,如果登录则显示首页,如果未登录则进入登录页面或注册页面
RecyclerView通过DPAD按键上下切换焦点 切换到界面外的控件时焦点会左右乱跳
Connection database time zone setting
EF Core: 一对一,多对多的配置
五个关联分析,领略数据分析师一大重要必会处理技能
WPS如何进行快速截屏?WPS快速截屏的方法
安装spinning up教程里与mujoco对应的gym,报错mjpro150
[untitled]
leetcode 763. Partition Labels 划分字母区间(中等)
Stack and queue and priority queue (large heap and small heap) simulation implementation and explanation of imitation function
MySQL定时调用预置函数完成数据更新
Flink+iceberg environment construction and production problem handling
盒子水平垂直居中布局(总结)
虚拟偶像的歌声原来是这样生成的!
[C language] PTA 7-47 binary leading zero
钉钉对话框文子转换成图片 不能复制粘贴到文档上
Torch.nn.crossentropyloss() details
Build auto.js script development environment
Mysql:the user specified as a definer ('root '@'%) does not exist
Opencv learning 1 (environment configuration)