Get transactional message link metrics
Returns metrics for clicked links from a transactional message, both in total and in series periods (days, weeks, etc). series metrics are ordered oldest to newest (i.e. the 0-index for any result is the oldest step/period).
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: integertransactional
_id requiredThe identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL -
/transactional/3/templates/139- thetransactional_idis 3.
- 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: booleanunique
If true, the response contains only unique customer results, i.e. a customer who clicks a link twice is only counted once. If false, the response contains the total number of results without regard to uniqueness.
- application/json
- 404
The transactional message you requested does not exist.
- 429
Your request is over the 10-per-second limit.
curl 'https://api.customer.io/v1/transactional/1/metrics/links?period=days&steps=1&unique=false' \
--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 an array of link objects. Each object represents a different link in your transactional message and contains independent metrics.