GET /client/authorize
| Description | Each authentication flow initially starts at this endpoint. An app must forward the user or open a new browser to this location with the correct parameters. |
||||||||||||
| URL | https://my.hidrive.com/client/authorize | ||||||||||||
| Parameters |
|
||||||||||||
| Example Usage |
|
||||||||||||
| Response | Note: an authorization code is short-lived and needs to be used within five minutes at the /oauth2/token endpoint.
In case of “oob”, the user will be provided with a short code, to enter into your app. Otherwise, the response will be a redirect back to your redirect_uri providing information as follows:
|
||||||||||||
| Errors | This endpoint handles errors in two different ways. If client_id verification failed or you provided an invalid value for lang or redirect_uri, errors will be displayed to the user on the authorization page.If you provided a valid client_id, the following errors will be redirected back to your registered redirect_uri:
|
POST /oauth2/token
| Description | Depending on the parameters used for the call, this endpoint can serve one of two purposes: 1) It allows you to retrieve a new refresh_token following initial “code” flow authorization. 2) It may be used to generate a valid access_token anytime, using an existing and valid refresh_token.Notice: This endpoint can’t be used by apps that do not possess a client_secret! |
||||||||||
| URL | https://my.hidrive.com/oauth2/token | ||||||||||
| Parameters |
|
||||||||||
| Example Usage |
|
||||||||||
| Response | In both cases you’ll get a valid access_token. Whereas grant_type=authorization_code creates it, either case returns the valid refresh_token. It is strongly suggested to store this refresh_token in a secure and persistent way for future use.Example result: {
"refresh_token":"...",
"expires_in":3600,
"userid":"...",
"access_token":"...",
"alias":"...",
"token_type":"Bearer",
"scope":"ro,user"
}
|
||||||||||
| Errors |
|
POST /oauth2/tokeninfo
| Description | An endpoint you may use to get information about your current access_token. The response will include the granted scope, expiry time, user alias and your client_id. | ||
| URL | https://my.hidrive.com/oauth2/tokeninfo | ||
| Parameters |
|
||
| Example Usage |
|
||
| Response | For a valid access_token the response consists of current information about the expiry, scope, client_id and HiDrive user alias.
{
"expires_in": 3202,
"client_id": "<client_id>",
"alias": "foobar",
"scope": "rw,owner"
}
|
||
| Errors |
|
POST /oauth2/revoke
| Description | Revoke an active access_token or refresh_token.
Revoking a refresh_token will also invalidate all related access_token. Revoking the refresh_token is the easiest way to accomplish a logout mechanism for your app. This is a functionality we explicitly encourage you to implement. Note: use a content-type of |
||||||
| URL | https://my.hidrive.com/oauth2/revoke | ||||||
| Parameters |
|
||||||
| Example Usage |
|
||||||
| Response | In case of success this endpoint returns a simple 200 response without content. | ||||||
| Errors |
|