Chilkat Online Tools

PowerBuilder / PandaDoc API Reference / Get Access Code

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_QueryParams = create oleobject
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_QueryParams.UpdateString("client_id","{{client_id}}")
loo_QueryParams.UpdateString("redirect_uri","{{redirect_uri}}")
loo_QueryParams.UpdateString("scope","read write")
loo_QueryParams.UpdateString("response_type","code")

loo_Resp = loo_Http.QuickRequestParams("GET","https://app.pandadoc.com/oauth2/authorize",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_QueryParams
    return
end if

Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp


destroy loo_Http
destroy loo_QueryParams

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": [
  ]
}