Skip to main content
Solved

Query Metric Aggregates

  • October 25, 2022
  • 2 replies
  • 236 views

Forum|alt.badge.img+3
  • Contributor I
  • 2 replies

Hi,

 

I am trying to build some reporting using the new API. First one I am trying to pull is Bounced Email metric, split by Bounce Type. Here is the data payload I am working with, not sure what I need to change in order to get the correct response.

 

Ideally it responds with number of hard bounce and soft bounce per day.

{
     "data": {
          "type": "metric-aggregate",
          "attributes": {
               "measurements": [
                    "count"
               ],
               "return_fields": [
                    "Bounce Type"
               ],
               "filter": [
                    "greater-or-equal(datetime,2022-07-01T00:00:00)",
"less-than(datetime,2022-10-24T00:00:00)"
               ],
               "metric_id": "U54J6U",
               "interval": "day",
               "timezone": "UTC"
          }
     }
}

 

Best answer by rpaul12

Try using the by param:

“by”: [“Bounce Type”]

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

Forum|alt.badge.img+2
  • Problem Solver I
  • 3 replies
  • Answer
  • October 25, 2022

Try using the by param:

“by”: [“Bounce Type”]


Forum|alt.badge.img+3
  • Author
  • Contributor I
  • 2 replies
  • October 26, 2022

Knew it was something simple! Appreciate the quick help!