Guest API: Events
Product events from the app or website, in batches.
| What it does | Route |
|---|---|
| Send product events | POST /guest/v1/events |
Send product events
Section titled “Send product events”POST /guest/v1/events
A batch of up to 50 events. Each is kept or refused on its own; an event’s id makes a retry safe. Send the standard events and the ones your app defines on the Data page.
Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.
Body (application/json): EventsBody
| Field | Type | Description |
|---|---|---|
app_version (always) | string | |
events (always) | array of EventBody | |
platform (always) | DevicePlatform (one of ios, android, web) | |
sent_at | string (date-time) | The phone’s clock as it sent the batch, drawn again for each attempt: PurrCRM measures the phone’s clock by it (ClockSkew) and moves every event’s OccurredAt by as much, so that a phone whose clock is wrong neither makes everything late nor puts it in the future. Left out by apps older than it, whose events are taken as their clocks say. |
time_zone | string | The phone’s IANA zone name (“Europe/London”), which PurrCRM uses for a guest’s quiet hours. Left out when the phone does not say. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 202 | EventsAccepted | Accepted |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 429 | problem | Too many requests: wait for Retry-After. |