zoukankan      html  css  js  c++  java
  • 百度网盘API调用一


    获取api_key
    api_key : GSccEhhbzxM4jKi5kqABPfwn
    secret_key : CDGOGIE8ZAIP3qooKbUpLpUrxnP2PUvo
    get:
    http://developer.baidu.com/rest/2.0/dev/v1/app/base/get?app_id=14512550&access_token=10.182e0fcde4fc1551180b8303cd35dcfd.1540223376.1183630

    1.在浏览器中输入:获取授权码:2220bc6cbf1dc533cce7968963f20c23
    https://openapi.baidu.com/oauth/2.0/authorize?response_type=code&client_id=GSccEhhbzxM4jKi5kqABPfwn&redirect_uri=oob


    3.通过刚刚新建应用的API Key获取device code和user_code
    curl -k -L -d "client_id=GSccEhhbzxM4jKi5kqABPfwn&response_type=device_code&scope=basic,netdisk" "https://openapi.baidu.com/oauth/2.0/device/code"
    {"device_code":"b4adab18f1ef0807d62cebddac2adea7","user_code":"u67xpvun","verification_url":"https://openapi.baidu.com/device","qrcode_url":"http://openapi.baidu.com/device/qrcode/0f274a778605dc24bae7dec0b612e5f9/u67xpvun","expires_in":1800,"interval":5}

    4.获取access_token:
    curl -k -L -d "grant_type=device_token&code=b4adab18f1ef0807d62cebddac2adea7&client_id=GSccEhhbzxM4jKi5kqABPfwn&client_secret=CDGOGIE8ZAIP3qooKbUpLpUrxnP2PUvo" "https://openapi.baidu.com/oauth/2.0/token"
    {"expires_in":2592000,"refresh_token":"27.4ce9e9aaa03764f915a19a754180e367.315360000.1855584874.2659222677-14512550","access_token":"26.773c43533edc9c14df1c58419a335cc7.2592000.1542816874.2659222677-14512550","session_secret":"5d7d9804b4c3ab764924ef8198edf593","session_key":"9m7YJ/56bOAlfLeTQi7/9fFV2OWXQOFWaBZ+VIvhJvz1GTtHaKk7WYRv6GHRPLtlLXl92/l5Sg1lK4yWpjM590j2FlVLe74iow8=","scope":"basic netdisk"}


    5.查看网盘配额:一下接口报错{"error_code":31024,"error_msg":"app id is empty","request_id":6842223964839647037}

    curl -k -L "https://pcs.baidu.com/rest/2.0/pcs/quota?method=info&access_token=26.773c43533edc9c14df1c58419a335cc7.2592000.1542816874.2659222677-14512550&client_id=GSccEhhbzxM4jKi5kqABPfwn"


    curl -k -L "https://pcs.baidu.com/rest/2.0/pcs/file?method=list&access_token=26.773c43533edc9c14df1c58419a335cc7.2592000.1542816874.2659222677-14512550&client_id=GSccEhhbzxM4jKi5kqABPfwn&client_secret=CDGOGIE8ZAIP3qooKbUpLpUrxnP2PUvo&path=/apps/pcsupload/"

  • 相关阅读:
    使用事务和SqlBulkCopy导入大批量数据
    Windows Server中禁止Administrator用户登录远程桌面
    SQL和C#的常用时间日期处理
    转:SQL Server数据库查询速度慢的原因
    火把节之夜,想发飙
    判断一个字符串是否为空
    .net中的using批注
    [转帖]删除鼠标右键的“用阿里旺旺打开此文件”的命令
    近凌晨12点却毫无睡意
    SQL SERVER取得汉字的拼音缩写
  • 原文地址:https://www.cnblogs.com/gzu-link-pyu/p/9834028.html
Copyright © 2011-2022 走看看