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 ----

lianja / easybill REST API / Fetch pdf document

Back to Collection Items

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

loHttp = createobject("CkHttp")

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

loSbResponseBody = createobject("CkStringBuilder")
llSuccess = loHttp.QuickGetSb("https://api.easybill.de/rest/v1/documents/:id/pdf",loSbResponseBody)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loSbResponseBody
    return
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": ""
    }
  ]
}