Chilkat Online Tools

unicodeCpp / APPIA API / GET A PAYMENT LINK DETAILS

Back to Collection Items

#include <CkHttpW.h>
#include <CkStringBuilderW.h>

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

    CkHttpW http;
    bool success;

    // Adds the "Authorization: Bearer {{auth}}" header.
    http.put_AuthToken(L"{{auth}}");
    http.SetRequestHeader(L"Content-Type",L"application/json");

    CkStringBuilderW sbResponseBody;
    success = http.QuickGetSb(L"https://domain.com/plink/details/2",sbResponseBody);
    if (success == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    wprintf(L"Response status code = %d\n",http.get_LastStatus());
    wprintf(L"%s\n",sbResponseBody.getAsString());
    }

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{auth}}"
https://domain.com/plink/details/2

Postman Collection Item JSON

{
  "name": "GET A PAYMENT LINK  DETAILS",
  "protocolProfileBehavior": {
    "disableBodyPruning": true
  },
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{auth}}",
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{auth}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": ""
    },
    "url": {
      "raw": "{{url}}/plink/details/2",
      "host": [
        "{{url}}"
      ],
      "path": [
        "plink",
        "details",
        "2"
      ]
    }
  },
  "response": [
  ]
}