I’m really scratching my head how to use your API. I’ve created a Client Application and have those details. What is the point of having a Redirect URI and Website listed here? All I want to do is make a request to the API and for the API to return the status of all my units in a specific group.
I’m finding it hard to figure out how to program this. I have worked with other API interfaces and this one seems a bit different with the Redirect URI and what not. I don’t want to be redirected anywhere I just want to pass information to get a key and get the proper response to get a token. I need some help.
OAuth has different grant type, depends on the your application needs, to obtain the access token with client ID and client secret, you may grant access thru the “client_credentials” flow, for detail information regarding OAuth, please refer to below URL.
With RESTful client
Login to InControl2
In any organization/network/device overview, on the top right hand corner, click on your login email address before the “Sign out” link, that would bring you to account setting page.
At the bottom of the page, there is a “Client Application” section, click on “New Client”
Enter the name and checked “Enable”, other fields can be leave blank, then click “Save”
Click on the application name that you just created, you should see “Client ID” and “Client Secret” at the bottom of the popup window
Now you can obtain a token with that client ID and secret
With HTTP Call
POST https://api.ic.peplink.com/api/oauth2/token
Encoding: application/x-www-form-urlencoded
Data: client_id=[your_client_id]&client_secret=[your_client_secret]&grant_type=client_credentials
Or with CURL command:
curl -X POST -H “Content-Type: application/x-www-form-urlencoded” --data “client_id=[your_client_id]&client_secret=[your_client_secret]&grant_type=client_credentials” https://api.ic.peplink.com/api/oauth2/token
hello, I’m trying to use the api using the curl function in php, I already have my client code and my secret code but I do not know what value I should put in the grant_type = client_credentials. what value is the client_credentials.
Thank you