This is a basic example of retrieving a list of model Audit logs using 1CRM API.
$model = $client->model('Account');
$result = $model->getAuditLogs(null, 0, 2);
printf("There are %d records in total\n", $result->totalResults());
echo json_encode($result->getRecords(), JSON_PRETTY_PRINT), "\n";
Output:
1 There are 1162 records in total
4 "id": "d1b32ea5-44c3-8fb8-aa14-5ed50426146f",
7 "date_created": "2020-06-01 13:39:08",
9 "parent_id": "aabdeac3-5a0c-577b-b32a-5d653164cb4c",
10 "field_name": "phone_office",
12 "before_value_string": null,
13 "after_value_string": "+1-999-99-9999",
14 "before_value_text": null,
15 "after_value_text": null,
20 "id": "760202ef-79ec-c9f5-3505-5ec28073a175",
21 "created_by_user": "admin",
23 "date_created": "2020-05-18 12:31:03",
25 "parent_id": "52600b8b-bc77-1980-687b-5ec28069bd95",
26 "field_name": "assigned_user_id",
28 "before_value_string": null,
29 "after_value_string": "1",
30 "before_value_text": null,
31 "after_value_text": null,
$account_id = '87056d90-0fbd-1202-f074-5c9b250f15af';
$model = $client->model('Account');
$result = $model->getAuditLogs($account_id, 0, 2);
printf("There are %d records in total\n", $result->totalResults());
echo json_encode($result->getRecords(), JSON_PRETTY_PRINT), "\n";
Output:
1 There are 6 records in total
4 "id": "877f6492-8efe-2cc3-7c5a-5c9b250724a4",
5 "created_by_user": "admin",
7 "date_created": "2019-03-27 07:24:57",
9 "parent_id": "87056d90-0fbd-1202-f074-5c9b250f15af",
10 "field_name": "assigned_user_id",
12 "before_value_string": null,
13 "after_value_string": "1",
14 "before_value_text": null,
15 "after_value_text": null,
20 "id": "8780dcdf-373a-d5b1-19d5-5c9b25297b19",
21 "created_by_user": "admin",
23 "date_created": "2019-03-27 07:24:57",
25 "parent_id": "87056d90-0fbd-1202-f074-5c9b250f15af",
28 "before_value_string": null,
29 "after_value_string": "1CRM Systems Corp.",
30 "before_value_text": null,
31 "after_value_text": null,