当前位置:网站首页>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
边栏推荐
- 让你的正则表达式可读性提高一百倍
- Opencv environment construction
- Configure st-gcn environment record [Google lab]
- After the spinning up installation is completed, use the tutorial to test whether it is successful. There are library "Glu" not found and 'from pyglet.gl import * error solutions
- 1 句代码,搞定 ASP.NET Core 绑定多个源到同一个类
- 电脑无法打开excel表格怎么办?excel打不开的解决方法
- Opencv learning 1 (environment configuration)
- How to open IE browser by running win command
- File operation (Advanced C language)
- 使用更灵活、更方便的罗氏线圈
猜你喜欢

Traffic flow prediction pit climbing record (I): traffic flow data set, original data

带你一文理解JS数组

Classes and objects (I)

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

Learn matlab to draw geographical map, line scatter bubble density map

网络之以太网

Google browser opens the web page and out of memory appears

安装spinning up教程里与mujoco对应的gym,报错mjpro150

ios面试准备 - 网络篇

GCC Basics
随机推荐
How to avoid damage of oscilloscope current probe
Word如何查看文档修改痕迹?Word查看文档修改痕迹的方法
Stack and queue and priority queue (large heap and small heap) simulation implementation and explanation of imitation function
带你搞懂 Kubernetes 集群中几种常见的流量暴露方案
Install the gym corresponding to mujoco in the spinning up tutorial, and the error mjpro150 is reported
After the spinning up installation is completed, use the tutorial to test whether it is successful. There are library "Glu" not found and 'from pyglet.gl import * error solutions
Implementation of flutter gesture monitoring and Sketchpad
def fasterrcnn_resnet50_fpn()实例测试
使用更灵活、更方便的罗氏线圈
MySQL regularly calls preset functions to complete data update
C语言之基础语法
网络之以太网
IOS interview preparation - Objective-C
WPS插入超链接无法打开,提示“无法打开指定文件”怎么办!
Auto.js脚本开发环境搭建
Google browser opens the web page and out of memory appears
[C language] PTA 7-47 binary leading zero
Opencv environment construction
1 sentence of code, get asp Net core binds multiple sources to the same class
Reveal安装配置调试