diff --git a/README.md b/README.md index 5e16704..943804b 100644 --- a/README.md +++ b/README.md @@ -496,7 +496,7 @@ All methods that you will most likely need when building a Crisp integration are * **List Events** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-people-events) - * `CrispClient->websitePeople->listPeopleEvent(websiteId, peopleId, pageNumber)` + * `CrispClient->websitePeople->listPeopleEvents(websiteId, peopleId, pageNumber)` *
See Example @@ -505,7 +505,7 @@ All methods that you will most likely need when building a Crisp integration are $peopleId = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"; $pageNumber = 1; - CrispClient->websitePeople->listPeopleEvent(websiteId, peopleId, pageNumber); + CrispClient->websitePeople->listPeopleEvents(websiteId, peopleId, pageNumber); ```
diff --git a/src/Resources/WebsitePeople.php b/src/Resources/WebsitePeople.php index 9f1399d..62866c3 100644 --- a/src/Resources/WebsitePeople.php +++ b/src/Resources/WebsitePeople.php @@ -209,6 +209,23 @@ public function addPeopleEvent($websiteId, $peopleId, $data) * @throws ClientExceptionInterface * @throws CrispException */ + public function listPeopleEvents($websiteId, $peopleId, $pageNumber = 1) + { + $result = $this->crisp->get( + "website/$websiteId/people/events/$peopleId/list/$pageNumber" + ); + return $this->formatResponse($result); + } + + /** + * @param string $websiteId + * @param string $peopleId + * @param int $pageNumber + * @return array + * @throws ClientExceptionInterface + * @throws CrispException + */ + #[\Deprecated(message: 'use listPeopleEvents() instead')] public function listPeopleEvent($websiteId, $peopleId, $pageNumber) { $result = $this->crisp->get(