Get link metrics for an action
Returns link click metrics for an individual action. Unless you specify otherwise, the response contains data for the maximum period by days (45 days).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1 means two days - the 48 hours before the API request was made. ?period=days&steps=0 returns the same as the maximum of the period - ?period=days&steps=45. See the steps parameter below for the maximum count of each period.
- Type: integercampaign
_id requiredThe ID of the campaign that you want to trigger or return information about.
- Type: integeraction
_id requiredThe action you want to lookup or act on.
- Type: stringenumperiod
The unit of time for your report.
values- hours
- days
- weeks
- months
- Type: integersteps
The number of periods you want to return. Defaults to the maximum available, or
12if the period is inmonths. Maximums are 24 hours, 45 days, 12 weeks, or 121 months. Days start at 00:00 EST. Weeks start at 00:00 EST on Sunday. Months start at 00:00 EST on the 1st of the month. - Type: stringenumtype
The type of item you want to return metrics for. When empty, the response contains metrics for all possible types.
values- email
- webhook
- twilio
- whatsapp
- slack
- push
- in
_app - live
_notification
- application/json
- 400
The
campaignIDoractionIDis invalid. - 404
The campaign and/or action do not exist.
- 429
Your request is over the 10-per-second limit.
curl 'https://api.customer.io/v1/campaigns/3/actions/1/metrics/links?period=days&steps=1&type=email' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"links": [
{
"link": {
"id": 1234,
"href": "https://docs.customer.io"
},
"metric": {
"series": {
"clicked": [
1,
3,
5,
7
],
"human_clicked": [
1,
2,
3,
4
],
"machine_clicked": [
0,
1,
1,
2
]
}
}
}
]
}Returns action metrics by series (with increments are based on the period and step in your request) for the campaign.