Obtain access token
Last updated
Last updated
External applications could obtain a user authorized API token via the OAuth2 protocol. Before getting started, developers need to create their applications in and configure a valid OAuth redirect URL. A registered Raindrop.io application is assigned a unique Client ID
and Client Secret
which are needed for the OAuth2 flow.
This procedure is comprised of several steps, which will be described below.
GET
https://raindrop.io/oauth/authorize
Direct the user to our authorization URL with specified request parameters.
\
— If the user is not logged in, they will be asked to log in
\
— The user will be asked if he would like to grant your application access to his Raindrop.io data
redirect_uri
string
Redirect URL configured in your application setting
client_id
string
The unique Client ID of the Raindrop.io app that you registered
Here example CURL request:
When the user grants your authorization request, the user will be redirected to the redirect URL configured in your application setting. The redirect request will come with query parameter attached: code
.
The code
parameter contains the authorization code that you will use to exchange for an access token.
In case of error redirect request will come with error
query parameter:
access_denied
When the user denies your authorization request
invalid_application_status
When your application exceeds the maximum token limit or when your application is being suspended due to abuse
POST
https://raindrop.io/oauth/access_token
Once you have the authorization
code
, you can exchange it for the
access_token
by doing a
POST
request with all required body parameters as JSON:
Content-Type
string
application/json
grant_type
string
authorization_code
code
string
Code that you received in step 2
client_id
string
The unique Client ID of the Raindrop.io app that you registered
client_secret
string
Client secret
redirect_uri
string
Same
redirect_uri
from step 1
Here an example CURL request:
POST
https://raindrop.io/oauth/access_token
For security reasons access tokens (except "test tokens") will
expire after two weeks
. In this case you should request the new one, by calling
POST
request with body parameters (JSON):
Content-Type
string
application/json
client_id
string
The unique Client ID of your app that you registered
client_secret
string
Client secret of your app
grant_type
string
refresh_token
refresh_token
string
Refresh token that you get in step 3