PCS API

PCS API

1、进入 http://developer.baidu.com/console#manage/apilist! 创建项目
2、https://openapi.baidu.com/oauth/2.0/authorize?response_type=code&client_id={API Key}&redirect_uri=oob,替换API KEY进行授权,获取授权码AccessToken

3、https://openapi.baidu.com/oauth/2.0/token?grant_type=authorization_code&code={Access Token}&client_id={API Key}&client_secret={Secret Key}&redirect_uri=oob 
redirect_uri默认为oob,参照百度帮助文档->OAuth
得到结果如下:
{
"expires_in":xxx,
"refresh_token":"xxx",
"access_token":"xxx",
"session_secret":"xxx",
"session_key":"xxx",
"scope":"basic"
}
4、参照官方格式替换http://developer.baidu.com/wiki/index.php?title=docs/oauth/redirect
进入项目->安全设置按照以下格式替换后提交:
http://openapi.baidu.com/oauth/2.0/login_success#expires_in=2592000&access_token=21.c000626bf8880c097aaee27aed9842ed.2592000.1522823522.2468651268-10881219&session_secret=d2f757193b1b5fc2d319e6f1fa07edfd&session_key=9mnRJ9ezymUnX8HYFHbXlgs1Dw4\/Ai9suCZc2IMxaEtL7aOrGgfwE59H9Us8Y4kMwWV3kjg9kD6nlOV4VRTKp8rs965SvebsDYQ=&scope=basic
5、授权成功后,参照帮助文档->REST API->API列表里的接口及示例调用
posted @ 2018-03-05 14:53 DELH 阅读( ...) 评论( ...) 编辑 收藏

猜你喜欢

转载自blog.csdn.net/dreamerLLL/article/details/86165968