Back to Collection Items
#include <C_CkHttp.h>
#include <C_CkStringBuilder.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
HCkStringBuilder sbResponseBody;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
CkHttp_SetRequestHeader(http,"Authorization","{{apiKey}}");
CkHttp_SetRequestHeader(http,"Accept","application/pdf");
sbResponseBody = CkStringBuilder_Create();
success = CkHttp_QuickGetSb(http,"https://api.easybill.de/rest/v1/documents/:id/pdf",sbResponseBody);
if (success == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
CkStringBuilder_Dispose(sbResponseBody);
return;
}
ERROR: "=" expected
ERROR: Undefined variable(ERROR)
CkHttp_Dispose(http);
CkStringBuilder_Dispose(sbResponseBody);
}
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": ""
}
]
}