Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ All methods that you will most likely need when building a Crisp integration are
</details>

* **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)`
* <details>
<summary>See Example</summary>

Expand All @@ -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);
```
</details>

Expand Down
17 changes: 17 additions & 0 deletions src/Resources/WebsitePeople.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down