FDS Restful API

OAuth related api supported by FDS

Version: 1.0.0

/

GET

Summary:

获取OAuth存储令牌

Description:

OAuth认证,使用OAuth认证前请仔细阅读FDS相关文档,并给我们发送申请邮件

Parameters
Name Located in Description Required Schema
storageAccessToken query 占位符,不需要有值 Yes string
appId query 在dev.xiaomi.com上申请的appId Yes string
oauthAccessToken query 通过三方OAuth认证获取的访问令牌 Yes string
oauthOpenId query 通过XiaoMiOAuth认证时必须包含,用户的OpenID No string
oauthAppId query 通过三方OAuth认证对应的appId Yes string
oauthProvider query 三方OAuth,可以是XiaoMi, QQ, Sina, RenRen Yes string
oauthMacKey query 通过XiaoMiOAuth认证时必须包含,在获取授权码时返回的签名密钥 No string
oauthMacAlgorithm query 通过XiaoMiOAuth认证时必须包含,在获取授权码时返回的签名算法 No string
Responses
Code Description Schema
200 获取的OAuth存储令牌 StorageAccessTokenResult

Models

StorageAccessTokenResult

Name Type Description Required
token string 由FDS生成的访问令牌 No
expireTime long 有效期限(1周) No

命令行示例

curl --request GET \
  --url 'https://cnbj0.fds.api.xiaomi.com/?storageAccessToken=&appId=2882303761517436430&oauthAppId=2882303761517454151&oauthAccessToken=V2xxxxhcQ&oauthProvider=XiaoMi&oauthMacAlgorithm=HmacSHA1&oauthMacKey=I60xxxxdo' \
  --header 'cache-control: no-cache'
< HTTP/1.1 200 OK
< Server: Tengine
< Date: Sat, 04 Feb 2017 09:46:25 GMT
< Content-Type: application/json
< Content-Length: 167
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Methods: GET, POST, PUT, HEAD, DELETE, OPTIONS
< Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Content-MD5
< Access-Control-Expose-Headers: content-md5, upload-time, x-xiaomi-meta-content-length
< 
* Connection #0 to host files.fds.api.xiaomi.com left intact
* Closing connection #0
{"expireTime":1486806381536,"token":"2idxxxAO"}

results matching ""

    No results matching ""