Getting started with Oauth 2 on TipeeeStream

Although most of the data on the TipeeeStream API are readable by providing only your API Key, some informations require authentication.

To access endpoints with authentication, you must create your Oauth Client and save your redirect URLs in your TipeeeStream API settings.
Then follow these steps :

1. Send your user from your application to our Authentication url

https://api.tipeeestream.com/oauth/v2/auth?client_id={your-client-ID}&response_type=code&redirect_uri={your-redirect-url}

Don't forget to save the redirect url in your settings first.

After accepting your application, the user will be sent to your redirect url with a code parameter :

{your-redirect-url}?code=....

2. Post the provided code to our OAuth Token url

https://api.tipeeestream.com/oauth/v2/token
client_id=client_id
&client_secret=client_secret
&redirect_uri=redirect_uri
&code=authorization_code
&grant_type=authorization_code
{
    "access_token" : "access_token",
    "refresh_token" : "refresh_token",
    "token_type" : "bearer",
    "expires_in" : 86400
}

3. Get the user's informations with the access_token

You can add the access_token in a query string or in your header when you read the API endpoints.

https://api.tipeeestream.com/v1.0/me?access_token=your-access-token
https://api.tipeeestream.com/v1.0/me/api?access_token=your-access-token

You can also put the access_token in a Authorization header

Authorization: Bearer access_token

4. Refresh user's token

https://api.tipeeestream.com/oauth/v2/refresh-token
client_id=client_id
&client_secret=client_secret
&refresh_token=refresh_token
{
	"access_token": "access_token",
	"refresh_token": "refresh_token",
	"scope":null
}