Sign inGet Started

Get aggregate inbound Apple Messages for Business statistics

GET
/v1/amb/stats/inbound/summary
const result = await bird.amb.stats.inbound.summary();
console.log(result);
Odpowiedź200
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-25",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "attribution": "accepted_time",
  "received": 4210,
  "comparison": {
    "period": {
      "from": "2026-05-01",
      "to": "2026-05-25",
      "data_as_of": "2026-05-25T14:03:10Z"
    },
    "received": 3980,
    "delta": {
      "received_pct_change": 0.058
    }
  }
}
Returns one aggregate row of inbound Apple Messages for Business counts for the requested period. Inbound statistics are attributed to when the event occurred, not to any earlier outbound message, so a reply received today counts against today regardless of when the conversation started. period.data_as_of is the freshness boundary the rollups have reached.
This channel has no delivery receipt and no derived rate; the response carries only the raw received count.
from and to must both be calendar days or RFC 3339 instants. Day windows cover up to 365 whole days. Instant bounds round down to the hour, remain inclusive, and may span up to 720 hours. Mixing the forms returns 422. Set timezone for local boundaries. Historical dates are supported within the maximum window length; the requested dates are not shifted forward.
Use compare=previous_period to include the preceding equal-length window and the change between the two.
Parametry zapytania
from
string
Inclusive start of the window: a calendar day (YYYY-MM-DD) or an RFC 3339 instant rounded down to the hour. The timezone parameter makes a calendar day local and rounds an instant down to the local hour. Omit timezone to use UTC. When timezone is set, a numeric UTC offset such as +05:45 is rejected; use a calendar day or a Z (UTC) instant. This value must use the same form as to. When omitted, it defaults to 30 days before to for day windows or 168 hours (7 days) before to for hour windows.
to
string
Inclusive end of the window: a calendar day (YYYY-MM-DD) or an RFC 3339 instant rounded down to the hour. The timezone parameter makes a calendar day local and rounds an instant down to the local hour. Omit timezone to use UTC. When timezone is set, a numeric UTC offset is rejected; use a calendar day or a Z (UTC) instant. This value must use the same form as from. When omitted, it defaults to today for day windows or the current hour for hour windows in that timezone. Day windows may not exceed 365 days; hour windows may not exceed 720 hours (30 days).
timezone
string
IANA timezone identifier used to group statistics, for example Asia/Kathmandu. The default is UTC. Day and hour boundaries, including the default window when from and to are omitted, follow this timezone. When this parameter is set, pass from and to as calendar days or Z instants instead of timestamps with explicit UTC offsets.
compare
string
Set to previous_period to also include the same statistics for the immediately preceding window of equal length, plus the change between the two, so you can show "+X% vs last period" without a second request.
Possible values: previous_period
Treść odpowiedzi
period
object
wymagane
The window the response covers (echoed back from the request), plus data_as_of, the freshness boundary the data is current to.
Pokaż atrybuty podrzędne
period.from
string
wymagane
Inclusive start of the window, as a calendar day (YYYY-MM-DD) or an RFC 3339 hour boundary. Historical starts are preserved; the maximum request length does not impose a historical cutoff.
period.to
string
wymagane
Inclusive end of the window, as a calendar day (YYYY-MM-DD) or an RFC 3339 hour boundary.
period.data_as_of
nullable string
Latest time reflected in the statistics. More recent events might not be included yet. Null when the freshness boundary is unavailable.
attribution
string
wymagane
Always event_time for inbound statistics.
Possible values: accepted_time, event_time
received
integer
wymagane
Distinct messages received in the period, counted by the time each message occurred. Computed across the whole window rather than summed from the daily or hourly series, so it can sit slightly below the sum of those rows.
comparison
object
The received-message count for the equal-length, inclusive period ending immediately before the requested start, together with the change between the two periods. Present only when compare=previous_period is requested. The change is already computed, so a percentage difference needs no second request.
Pokaż atrybuty podrzędne
comparison.period
object
wymagane
The preceding window these comparison figures cover, the equal-length window ending immediately before the requested start (the prior day for day windows, the prior hour for hour windows).
Pokaż atrybuty podrzędne
comparison.period.from
string
wymagane
Inclusive start of the window, as a calendar day (YYYY-MM-DD) or an RFC 3339 hour boundary. Historical starts are preserved; the maximum request length does not impose a historical cutoff.
comparison.period.to
string
wymagane
Inclusive end of the window, as a calendar day (YYYY-MM-DD) or an RFC 3339 hour boundary.
comparison.period.data_as_of
nullable string
Latest time reflected in the statistics. More recent events might not be included yet. Null when the freshness boundary is unavailable.
comparison.received
integer
wymagane
Distinct messages received in the preceding period.
comparison.delta
object
wymagane
The change from the preceding period to the requested one. The received_pct_change field is a signed relative change, computed as (current - previous) / previous. A value of 0.5 means 50% higher, and -0.2 means 20% lower. The field is null when the previous period received none.
Pokaż atrybuty podrzędne
comparison.delta.received_pct_change
nullable number
wymagane
Relative change in received messages versus the previous period, as a signed fraction. Null when the previous period received none.

Powiązane zasoby

Kontynuuj z dokumentacją, przewodnikami i przykładami dotyczącymi tego tematu. Zasoby są w języku angielskim.

Uzyskaj brief wdrożeniowy