IC2 API question


#1

Hi there

first of all I’m not a developer, so things like oauth2, rest and so on are a little obscure to me :slight_smile:

that said, I created a new app in my incontrol profile, and I have my client_id and secret_id, I granted my app… so far, so good…

the problem arise when I try to use them…

starting from this demo (https://github.com/keeth/Net-OAuth2/blob/master/demo/app.psgi) I have a webapp that obtain the access_token, but I need to accept everytime via a web form…

am I missing anything? should I ask for a clientid via email as per http://www.peplink.com/ic2-api-doc/ page?

TIA


#2

Typically access tokens have a pretty short lifespan. When you request for an access token, you should also receive a refresh token. When the access token expired, you can use the refresh token to acquire a new access token without having to accept again. Yes, we’d also suggest you to get a client ID when your app is going to go live.