Back to Collection Items
<?php
include("chilkat.php");
// Use "chilkat_9_5_0.php" for versions of Chilkat < 10.0.0
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
$http = new CkHttp();
$queryParams = new CkJsonObject();
$queryParams->UpdateString('from_date','{{from_date}}');
$queryParams->UpdateString('to_date','{{to_date}}');
// Adds the "Authorization: Bearer {{accessToken}}" header.
$http->put_AuthToken('{{accessToken}}');
$http->SetRequestHeader('Accept','application/json');
// resp is a CkHttpResponse
$resp = $http->QuickRequestParams('GET','https://domain.com/v2.1/accounts/{{accountId}}/connect/logs',$queryParams);
if ($http->get_LastMethodSuccess() == false) {
print $http->lastErrorText() . "\n";
exit;
}
print $resp->get_StatusCode() . "\n";
print $resp->bodyStr() . "\n";
?>
Curl Command
curl -G -d "from_date=%7B%7Bfrom_date%7D%7D"
-d "to_date=%7B%7Bto_date%7D%7D"
-H "Accept: application/json"
-H "Authorization: Bearer {{accessToken}}"
https://domain.com/v2.1/accounts/{{accountId}}/connect/logs
Postman Collection Item JSON
{
"name": "Gets the Connect log.",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"url": {
"raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/connect/logs?from_date={{from_date}}&to_date={{to_date}}",
"host": [
"{{baseUrl}}"
],
"path": [
"v2.1",
"accounts",
"{{accountId}}",
"connect",
"logs"
],
"query": [
{
"key": "from_date",
"value": "{{from_date}}"
},
{
"key": "to_date",
"value": "{{to_date}}"
}
],
"variable": [
{
"key": "accountId",
"value": "{{accountId}}",
"type": "string"
}
]
},
"description": "Retrieves a list of connect log entries for your account.\n\n###### Note: The `enableLog` setting in the Connect configuration must be set to true to enable logging. If logging is not enabled, then no log entries are recorded. "
},
"response": [
]
}