Chilkat Online Tools

ERROR!

------------------- GenerateCode ----------------------
---- begin chilkat script ----
// This example assumes the Chilkat API to have been previously unlocked.
// See {{-global_unlock:::Global Unlock Sample-}} for sample code.

new Http http;
ckbool success;

call http.SetRequestHeader("Authorization","{{apiKey}}");
call http.SetRequestHeader("Accept","application/pdf");

new StringBuilder sbResponseBody;
success = http.QuickGetSb("https://api.easybill.de/rest/v1/documents/:id/pdf",sbResponseBody);
if (success == ckfalse) {
    println http.LastErrorText;
    return;
}

ERROR: ExpectedResponseType not yet supported...
ExpectedResponseType: [application/pdf]
m_reqType = 8
ERROR: Something in the response processing not yet supported...

---- end chilkat script ----

Foxpro / easybill REST API / Fetch pdf document

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.

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')

loHttp.SetRequestHeader("Authorization","{{apiKey}}")
loHttp.SetRequestHeader("Accept","application/pdf")

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponseBody = CreateObject('Chilkat.StringBuilder')
lnSuccess = loHttp.QuickGetSb("https://api.easybill.de/rest/v1/documents/:id/pdf",loSbResponseBody)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loSbResponseBody
    CANCEL
ENDIF

ERROR: "=" expected
ERROR: Undefined variable(ERROR)

RELEASE loHttp
RELEASE loSbResponseBody

Curl Command

curl -X GET
	-H "Authorization: {{apiKey}}"
	-H "Accept: application/pdf"
https://api.easybill.de/rest/v1/documents/:id/pdf

Postman Collection Item JSON

{
  "name": "Fetch pdf document",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/pdf"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/documents/:id/pdf",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "documents",
        ":id",
        "pdf"
      ],
      "variable": [
        {
          "key": "id",
          "value": "<long>",
          "description": "(Required) ID of document"
        }
      ]
    }
  },
  "response": [
    {
      "name": "Successful operation",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/pdf"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/documents/:id/pdf",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "documents",
            ":id",
            "pdf"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/pdf"
        }
      ],
      "cookie": [
      ],
      "body": "<string>"
    },
    {
      "name": "Not found",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/documents/:id/pdf",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "documents",
            ":id",
            "pdf"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Too Many Requests",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/documents/:id/pdf",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "documents",
            ":id",
            "pdf"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}