Chilkat Online Tools

Foxpro / APPIA API / GET A VIRTUAL CARD DETAILS

Back to Collection Items

LOCAL loHttp
LOCAL lnSuccess
LOCAL loSbResponseBody

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

* Adds the "Authorization: Bearer {{auth}}" header.
loHttp.AuthToken = "{{auth}}"
loHttp.SetRequestHeader("Content-Type","application/json")

loSbResponseBody = CreateObject('Chilkat_9_5_0.StringBuilder')
lnSuccess = loHttp.QuickGetSb("https://domain.com/vcard/details/1",loSbResponseBody)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loSbResponseBody
    CANCEL
ENDIF

? "Response status code = " + STR(loHttp.LastStatus)
? loSbResponseBody.GetAsString()

RELEASE loHttp
RELEASE loSbResponseBody

Curl Command

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

Postman Collection Item JSON

{
  "name": "GET  A VIRTUAL CARD 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}}/vcard/details/1",
      "host": [
        "{{url}}"
      ],
      "path": [
        "vcard",
        "details",
        "1"
      ]
    },
    "description": "Send virtual card id as params"
  },
  "response": [
  ]
}