第9行: 第9行:
 
| redirect_uri || string || Redirection URI || No || displaycode
 
| redirect_uri || string || Redirection URI || No || displaycode
 
|-
 
|-
| response_type || string || Preferred response type || No || code
+
| response_type || string || Preferred response type || No || code/token
 
|-
 
|-
 
| client_id || string || Client ID of the client application || No
 
| client_id || string || Client ID of the client application || No
第21行: 第21行:
 
! Parameter !! Type !! Description !! Optional !! Choices
 
! Parameter !! Type !! Description !! Optional !! Choices
 
|-
 
|-
| code || string || Authorization code || No
+
| redirect_uri || string || Redirection URI, should match with previous requests || No
 +
|-
 +
| grant_type || string || Type of object to exchange token with || No || authorization_code/refresh_token
 
|-
 
|-
| redirect_uri || string || Redirection URI, should match with previous requests || No
+
| code || string || Authorization code, required for grant_type = authorization_code || Yes ||
 
|-
 
|-
| grant_type || string || Type of object to exchange token with || No || authorization_code
+
| refresh_token || string || Refresh token, required for grant_type = refresh_token || Yes ||
 
|-
 
|-
| client_id || string || Client ID of the client application || No
+
| client_id || string || Client ID of the client application || No ||
 
|-
 
|-
| client_secret || string || Client secret of the client application || No
+
| client_secret || string || Client secret of the client application || No ||
 
|}
 
|}
 
* Return value
 
* Return value
** Success: {"access_token": <string: Token>, "token_type": <string: Token type>}
+
** Success: {"access_token": <string: Token>, "token_type": <string: Token type>, ["refresh_token": <string: Refresh Token>,] "expires_in": <int: Seconds before expire> }
 
** Failure: various HTTP error code
 
** Failure: various HTTP error code

2013年1月19日 (六) 09:33的版本

登录

显示验证页面

GET /auth/auth
Parameter Type Description Optional Choices
redirect_uri string Redirection URI No displaycode
response_type string Preferred response type No code/token
client_id string Client ID of the client application No

获取Token

GET/POST /auth/token
Parameter Type Description Optional Choices
redirect_uri string Redirection URI, should match with previous requests No
grant_type string Type of object to exchange token with No authorization_code/refresh_token
code string Authorization code, required for grant_type = authorization_code Yes
refresh_token string Refresh token, required for grant_type = refresh_token Yes
client_id string Client ID of the client application No
client_secret string Client secret of the client application No
  • Return value
    • Success: {"access_token": <string: Token>, "token_type": <string: Token type>, ["refresh_token": <string: Refresh Token>,] "expires_in": <int: Seconds before expire> }
    • Failure: various HTTP error code