As a developer you just need to send users (administrators) to the authentication form, and then request the token from the “redirect url” on your server.
1. Get Authorization Code
https://app.onpipeline.com/auth-oauth/?client_id=your_client_id&redirect_url=redirect_url_encoded
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
You may also pass other variables to the redirect_url by adding them to the query string:
/auth-oauth/?client_id=your_client_id&redirect_url=https%3A%2F%2Fyourserver%2Fscript%3Fvar1%3Dhello
2. Get Access Token
Within your redirect url (script) you will send a GET or POST to the verify URL including:
- Client ID – client_id
- Client Secret – client_secret
- Code you have received in the query string of the redirect_url – code
Verify URL:
https://app.onpipeline.com/auth-oauth/verify
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:
$client_id = "your_client_id"; $client_secret = "your_client_secret"; $code = $_GET['code']; $verify_url="https://app.onpipeline.com/auth-oauth/verify"; $verify_url.="?client_id=$client_id&code=$code&client_secret=$client_secret"; $response = file_get_contents($verify_url);
Register as a Developer:
To obtain your client_id and client_secret, please get in touch with support@onpipeline.com