Get a broadcast's audience counts
/v1/email/broadcasts/{broadcast_id}/countsconst counts = await bird.broadcasts.counts("eb_01krdgeqcxet5s7t44vh8rt9mg");
console.log(counts.total, counts.addressable, counts.sendable);counts = client.broadcasts.counts("eb_01krdgeqcxet5s7t44vh8rt9mg")
print(counts.total, counts.addressable, counts.sendable)counts, err := client.Broadcasts.Counts(context.Background(), "eb_01krdgeqcxet5s7t44vh8rt9mg")
if err != nil {
log.Fatal(err)
}
fmt.Println(*counts.Total, *counts.Addressable, *counts.Sendable)$counts = $bird->broadcasts->counts('eb_01krdgeqcxet5s7t44vh8rt9mg');
echo $counts->getTotal(), ' ', $counts->getAddressable(), ' ', $counts->getSendable();bird email broadcasts counts <broadcast-id>curl -X GET "https://us1.platform.bird.com/v1/email/broadcasts/{broadcast_id}/counts" \
-H "Authorization: Bearer $TOKEN"{
"broadcast_id": "eb_01krdgeqcxet5s7t44vh8rt9mg",
"status": "draft",
"next": [
{
"kind": "operation"
}
],
"total": 13000,
"addressable": 12500,
"sendable": 12000
}
Returns a live estimate of how many contacts the broadcast can reach, narrowing from everyone in its audience down to the ones the send would go to.
totalis every contact in the audience.addressableis how many of those have an email address.sendableis how many addressable contacts are not suppressed for the broadcast's category.
A transactional broadcast still reaches a contact who unsubscribed from or complained about marketing mail. A marketing broadcast does not.
The estimate can change until the broadcast sends. The broadcast must have an audience selected; otherwise, the request returns 422.
These are audience numbers, and sending does not change them: after a send they still describe who the broadcast resolved to, not what happened to them. status says which of the two situations you are in. For delivery outcomes, read the broadcast's recipients for per-recipient status, its events for the raw feed, or email statistics by broadcast for the aggregates.
参数
broadcast_idstringBroadcast identifier. Starts with eb_.
响应载荷
broadcast_idThe broadcast these counts are for.
statusWhere the broadcast is in its lifecycle, so the counts read in context. Anything past draft or scheduled means these numbers describe an audience the broadcast has already been sent to, not one it is about to reach.
nextWhat to do next, given where the broadcast is. On a broadcast that has already sent this names the reads that carry delivery outcomes, which these counts never do. An empty list means there is nothing to do; the field is absent entirely on responses that do not report next actions.
显示子属性
next.kindWhat you do about this step.
operation: call the operation named inoperation, then read again.external: act somewhere this API does not reach, then read again.wait: nothing is asked of you, so read again later.terminal: nothing you do resolves this, so stop retrying.
Tolerate a value you do not recognize: show the description and
offer no action.
Possible values (may grow over time): operation, external, wait, terminal
next.descriptionA short, human-readable label for the step, suitable for display.
next.operationThe operationId to call. Present only when kind is operation. The operation's own schema says how to call it; this says only which one, and what to address it with.
next.paramsThe parameters that address the operation, by name: {"sender_id": "…"} for an operation on /v1/sms/senders/{sender_id}/requirements. A parameter the operation takes in its query string is given the same way, so an operation addressed as ?subject_id= carries {"subject_id": "…"}. Every parameter the call needs is here, whether its value came from the thing you were acting on or is fixed for this step, so you can make the call from this object alone. Present only when kind is operation and the operation names a subject. A request body, when the operation takes one, is described by the operation's own schema and never appears here.
next.urlA URL to open. Present only when kind is external, and only when the step has one. An external step whose description says to go and do something with no URL to open is normal.
totalHow many contacts are in the audience.
addressableHow many of those contacts have an email address. A contact with no address is not counted. This is never higher than total.
sendableHow many of the addressable contacts are not suppressed for this broadcast's category, which is who the email would actually go to. This is never higher than addressable. Which suppressions apply depends on the category, so the same audience can give a higher number for a transactional broadcast than for a marketing one. A transactional broadcast still reaches people who unsubscribed from or complained about marketing mail, and a marketing broadcast does not.