一、注册拼多多开放平台
https://open.pinduoduo.com/#/index
二、下载SDK
三、代码编写
1、导入SDK
开发者只能通过sdk访问成功该应用拥有权限包下的接口,无访问权限的接口仍无法访问。
<dependency>
<groupId>pdd</groupId>
<artifactId>duoduo</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/pop-sdk-0.0.4-all.jar</systemPath>
</dependency>
2、授权操作步骤
1)拼接授权url
拼接用户授权需访问url ,示例及参数说明如下:
商家授权:http(s)://mms.pinduoduo.com/open.html?response_type=code&client_id=4b646e71c7f987d5aab5435a672e4c9a &redirect_uri=http://www.oauth.net/2/&state=1212
移动端拼接授权URL:http(s)://mai.pinduoduo.com/h5-login.html?response_type=code&client_id=ca4a911edf0641f5a0e18c7ded3af71f&redirect_uri=https://www.baidu.com&&state=1212&view=h5
多多客授权:http(s)://jinbao.pinduoduo.com/open.html?client_id=ec049d08df8b5b082ba8566e73b94992&response_type=code&redirect_uri=http://hanshan.com
注意事项:
请求方法必须为POST方法,请求Header必须设置Content-Type:application/json,请求报文内容必须为JSON格式报文包。
商品地址:https://jinbao.pinduoduo.com/promotion/single-promotion