Skip to main content

Top Affiliates Involved

Retrieve aggregated data showing which affiliates were involved in incidents during the selected date range.

Endpoint

GET /hubspot/stats/top-affiliates-involved/: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>User authentication token
Note: No request body is required.

Response

Success Response (HTTP 200)

{
  "message": "",
  "data": {
    "affiliates": []
  }
}
  • affiliates: An array of affiliates involved in incidents during the date range.

Error Response (HTTP 400–500)

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

Authentication

This endpoint requires a valid authentication token via the Authorization header.

Example Request (cURL)

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

Example Request (JavaScript - fetch)

const response = await fetch(
  "/hubspot/stats/top-affiliates-involved/2025-11-01/2025-11-15",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_TOKEN"
    }
  }
);

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

Notes

  • The endpoint returns an empty array when no affiliates are found.
  • Date format must be YYYY-MM-DD.
  • Success is based solely on HTTP status code.