一:进入 http://developer.baidu.com/console#manage/apilist!
二:记录下API Key和Secret Key
三:Server端使用百度OAuth2.0授权调用开放API流程
详细文档:http://developer.baidu.com/wiki/index.php?title=docs/oauth/application
1.在浏览器中输入:https://openapi.baidu.com/oauth/2.0/authorize?response_type=code&client_id={API Key}&redirect_uri=oob
2. 复制下授权码
3. 获取到Access Token
在浏览器中输入:
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 从而获取到Access Token
输入结果如:http://developer.baidu.com/wiki/index.php?title=docs/pcs/guide/token_authorize
四、可以通过api操作云盘了
文档见:http://developer.baidu.com/wiki/index.php?title=docs/pcs/rest/file_data_apis_list
举例:在vps端获取磁盘容量信息
wget -O - "https://pcs.baidu.com/rest/2.0/pcs/quota?method=info&access_token={token}" 2>/dev/null