Get Event Count

From docs
Revision as of 15:41, 21 July 2026 by Ashley DeBon (talk | contribs) (Get Event Count)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Mobile_API »Get Event Count

Base URL

https://apimobile.callproof.com

Endpoint

/api/ai/chat-bot/get-event-count

Purpose

Returns how many events were created for one or more users in a company within a given date range. Used by the AI chat bot for event-count questions.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

None.

Query Parameters

None.

Request Body

Parameter Type Required Description
userId integer or array of integers Yes User ID(s) whose events should be counted
companyId integer Yes Company identifier
startDate string Yes Start date in Y-m-d format
endDate string Yes End date in Y-m-d format

Successful Response (200)

Returns the total event count for the given users, company, and date range.

Field Type Description
clientStatusCode integer Status indicator for the client (for example, 200)
user_id integer Identifier of the authenticated user
company_id integer Identifier of the authenticated user’s company
data integer Number of events created in the date range
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation failed – response body uses clientStatusCode 422 with the first validation error message
400 Bad Request – event count could not be retrieved
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 422) – Missing/invalid userId, companyId, startDate, or endDate (dates must be Y-m-d).
  • 400 – Invalid parameters ("Invalid input parameters.") or failure to fetch the count ("Failed to fetch event count.").
  • 401 – Authentication failed or the access token is missing/expired.