App Developers can use our OAuth authentication to generate API tokens. As a developer you just need to send our customers (admins only can use OAuth) to the authentication form, and then request the token from the “redirect url” on your server. Here is how it works.
User Login URL:
https://app.onpipeline.com/auth-oauth/?client_id=your_client_id&redirect_url=redirect_url_encoded
Redirect to your URL
If the user successfully logs in, the browser will be redirected to the redirect_url you set when the login form was loaded. The code you need to request a Token will be passed to the redirect url in the query string.
Example:
https://yourserver/script?code=b157b972475d1f4bdf3c333354b0a506cca23917258f816abe21
Obtaining a Token
Within your redirect url (script) you will send a get request to our verify url (see below) including both your Client ID and the Code you have received with the redirect.
https://app.onpipeline.com/auth-oauth/verify?client_id=your_client_id&code=b157b972475d…
The verify url will respond with a json object like the following:
{
“Client_Id”:”your_client_id“,
“Token”:”426d0e18ea0d1ec1c9ca7e0917280d75e5769a232f6daf38b55c”
}
Just save the Token value into your server and use it to connect to our API. Don’t forget to redirect the user to a thank you page including detailed information about your App usage.
Sample php code for your redirect script:
//set your client_id
$client_id = “your_client_id“;
$code = $_GET[‘code’];
$verify_url=”https://app.onpipeline.com/auth-oauth/verify”;
$verify_url.=”?client_id=$client_id&code=$code”;$response = file_get_contents($verify_url);
In order to obtain a Client ID please get in touch with support@onpipeline.com