Back to Collection Items
#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkJsonObjectW queryParams;
HCkHttpResponseW resp;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
queryParams = CkJsonObjectW_Create();
CkJsonObjectW_UpdateInt(queryParams,L"page",1);
CkJsonObjectW_UpdateString(queryParams,L"include_archived",L"false");
CkJsonObjectW_UpdateString(queryParams,L"sort_direction",L"desc");
CkJsonObjectW_UpdateString(queryParams,L"last_edit.time[gt]",L"2020-06-28T23:59:59-5:00");
// Adds the "Authorization: Bearer {{api_key}}" header.
CkHttpW_putAuthToken(http,L"{{api_key}}");
resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://rest.iad-01.braze.com/canvas/list",queryParams);
if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
CkJsonObjectW_Dispose(queryParams);
return;
}
wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
CkHttpResponseW_Dispose(resp);
CkHttpW_Dispose(http);
CkJsonObjectW_Dispose(queryParams);
}
Curl Command
curl -G -d "page=1"
-d "include_archived=false"
-d "sort_direction=desc"
-d "last_edit.time[gt]=2020-06-28T23%3A59%3A59-5%3A00"
-H "Authorization: Bearer {{api_key}}"
https://rest.iad-01.braze.com/canvas/list
Postman Collection Item JSON
{
"name": "Canvas List",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{api_key}}",
"type": "text"
}
],
"url": {
"raw": "https://{{instance_url}}/canvas/list?page=1&include_archived=false&sort_direction=desc&last_edit.time[gt]=2020-06-28T23:59:59-5:00",
"protocol": "https",
"host": [
"{{instance_url}}"
],
"path": [
"canvas",
"list"
],
"query": [
{
"key": "page",
"value": "1",
"description": "(Optional) Integer\n\nThe page of Canvases to return, defaults to `0` (returns the first set of up to 100)"
},
{
"key": "include_archived",
"value": "false",
"description": "(Optional) Boolean\n\nWhether or not to include archived Canvases, defaults to `false`."
},
{
"key": "sort_direction",
"value": "desc",
"description": "(Optional) String\n\nPass in the value `desc` to sort by creation time from newest to oldest. Pass in `asc` to sort from oldest to newest. If sort_direction is not included, the default order is oldest to newest."
},
{
"key": "last_edit.time[gt]",
"value": "2020-06-28T23:59:59-5:00",
"description": "(Optional) DateTime (ISO 8601 string)\n\nFilters the results and only returns Canvases that were edited greater than the time provided till now."
}
]
},
"description": "This endpoint allows you to export a list of Canvases, including the name, Canvas API Identifier and associated Tags. The Canvases are returned in groups of 100 sorted by time of creation (oldest to newest by default).\n\n> Archived Canvases will not be included in the API response unless the `include_archived` field is specified. Canvases that are stopped but not archived, however, will be returned by default.\n\n\n## Response\n\n```json\nContent-Type: application/json\nAuthorization: Bearer YOUR-REST-API-KEY\n{\n \"canvases\" : [\n \t{\n \t\t\"id\" : (string) Canvas API Identifier,\n \t\t\"last_edited\": (ISO 8601 string) the last edited time for the message,\n \t\t\"name\" : (string) Canvas name,\n \t\t\"tags\" : (array) tag names associated with the Canvas,\n \t},\n ... (more Canvases)\n ],\n \"message\": (required, string) the status of the export, returns 'success' when completed without errors\n}\n```"
},
"response": [
]
}