Chilkat Online Tools

unicodeCpp / CardPointe API Integration / Bin (Token)

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;

    http.SetRequestHeader(L"Authorization",L"Basic dGVzdGluZzp0ZXN0aW5nMTIz");
    http.SetRequestHeader(L"Content-Type",L"application/json");

    CkStringBuilderW sbResponseBody;
    success = http.QuickGetSb(L"https://domain.com/bin/{{merchid}}/{{token}}",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: Basic dGVzdGluZzp0ZXN0aW5nMTIz"
	-H "Content-Type: application/json"
https://domain.com/bin/{{merchid}}/{{token}}

Postman Collection Item JSON

{
  "name": "Bin (Token)",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Basic dGVzdGluZzp0ZXN0aW5nMTIz"
      },
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{url}}/bin/{{merchid}}/{{token}}",
      "host": [
        "{{url}}"
      ],
      "path": [
        "bin",
        "{{merchid}}",
        "{{token}}"
      ]
    },
    "description": "[Bin Documentation](https://developer.cardconnect.com/cardconnect-api#bin)"
  },
  "response": [
  ]
}