Skip to main content

Compliments Count

Returns aggregated count of compliments out of total feedbacks within a given date range.

Endpoint

GET /hubspot/stats/compliments-count/:startDate/:endDate

URL Parameters

ParameterTypeRequiredDescription
startDatestringStart date of the range (YYYY-MM-DD)
endDatestringEnd date of the range (YYYY-MM-DD)

Request Headers

HeaderValueDescription
AuthorizationBearer <token>Authentication token
Note: This endpoint does not accept a request body.

Response

Success Response (HTTP 200)

{
  "message": "",
  "data": {
    "total": 0,
    "compliments": 0,
    "percentage": 0
  }
}
  • total: Total number of tickets in the given date range
  • compliments: Number of compliment-type tickets
  • percentage: Compliments expressed as a percentage of total tickets

Error Response (HTTP 400–500)

{
  "message": "Invalid params",
  "data": {}
}
Any non-200 status code indicates an error.

Authentication

Provide a valid token using the Authorization header.

Example Request (cURL)

curl -X GET "https://yourdomain.com/hubspot/stats/compliments-count/2025-11-01/2025-11-15" \
-H "Authorization: Bearer YOUR_TOKEN"

Example Request (JavaScript - fetch)

const res = await fetch(
  "/hubspot/stats/compliments-count/2025-11-01/2025-11-15",
  {
    method: "GET",
    headers: { "Authorization": "Bearer YOUR_TOKEN" }
  }
);

const data = await res.json();
console.log(data);

Notes

  • Dates must be provided in YYYY-MM-DD format.
  • Percentages are computed based on the compliment count relative to the total tickets.