provider Categories GET
/categories/stats/sums @utdk/sendgrid
/categories/stats/sums Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?]
**This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.**
If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10.
- sort_by_metric query
- The metric that you want to sort by. Must be a single metric.
- string
- sort_by_direction query
- The direction you want to sort.
- enum: desc, asc
- start_date query required
- The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.
- string
- end_date query
- The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.
- string
- limit query
- Limits the number of results returned.
- integer
- offset query
- The point in the list to begin retrieving results.
- integer
- aggregated_by query
- How to group the statistics. Must be either "day", "week", or "month".
- enum: day, week, month
- on-behalf-of header
- string
Try it
Authentication
Configure credentials for Email Activity (beta)
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import sendgrid from '@utdk/sendgrid';
await sendgrid.getCategoriesStatsSums({
"sort_by_metric": "delivered",
"sort_by_direction": "desc",
"limit": 5,
"offset": 0,
"on-behalf-of": "The subuser's username. This header generates the API call as if the subuser account was making the call."
})