Back to Collection Items
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http = new CkHttp();
boolean success;
CkJsonObject queryParams = new CkJsonObject();
queryParams.UpdateString("client_id","{{client_id}}");
queryParams.UpdateString("redirect_uri","{{redirect_uri}}");
queryParams.UpdateString("scope","read write");
queryParams.UpdateString("response_type","code");
CkHttpResponse resp = http.QuickRequestParams("GET","https://app.pandadoc.com/oauth2/authorize",queryParams);
if (http.get_LastMethodSuccess() == false) {
Log.i(TAG, http.lastErrorText());
return;
}
Log.i(TAG, String.valueOf(resp.get_StatusCode()));
Log.i(TAG, resp.bodyStr());
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}
Curl Command
curl -G -d "client_id=%7B%7Bclient_id%7D%7D"
-d "redirect_uri=%7B%7Bredirect_uri%7D%7D"
-d "scope=read%20write"
-d "response_type=code"
https://app.pandadoc.com/oauth2/authorize
Postman Collection Item JSON
{
"name": "Get Access Code",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://app.pandadoc.com/oauth2/authorize?client_id={{client_id}}&redirect_uri={{redirect_uri}}&scope=read+write&response_type=code",
"protocol": "https",
"host": [
"app",
"pandadoc",
"com"
],
"path": [
"oauth2",
"authorize"
],
"query": [
{
"key": "client_id",
"value": "{{client_id}}"
},
{
"key": "redirect_uri",
"value": "{{redirect_uri}}"
},
{
"key": "scope",
"value": "read+write"
},
{
"key": "response_type",
"value": "code"
}
]
},
"description": "Provide values to variables: client_id, redirect_url ([Postman environments](https://www.getpostman.com/docs/postman/environments_and_globals/manage_environments) is great for it).\n\nTest this link in a web browser.\n\nYou can get the URL by going to \"Code\" - \"cURL\".\n\nFor details go to [https://developers.pandadoc.com/v1/reference#authorize-a-user](https://developers.pandadoc.com/v1/reference#authorize-a-user).\n\nFor details of authentication process go to [https://developers.pandadoc.com/v1/reference#authentication-process](https://developers.pandadoc.com/v1/reference#authentication-process)."
},
"response": [
]
}