The answer is found in the Getting Started Guide.
Partial responses
Use field parameters to cut down on data transfers by limiting which
fields the MailChimp API returns. For example, you may not need the
full details of a resource, and can instead pass a comma-separated
list of specific fields you want to include.
The parameters fields and exclude_fields are mutually exclusive and
will throw an error if a field isn’t valid in your request. For example,
the following URL uses the fields query string parameter to only include
the list name and list id fields in the response:
https://usX.api.mailchimp.com/3.0/lists?fields=lists.name,lists.id
Now, you might be wondering, "How do I add parameters to a batch request?" Fortunately, the MailChimp documentation is here for you. Refer to the How to use Batch Operations guide, which tells you to include an field called params
in your operation object.
In the example above, you would do the following:
{
"operations": [{
"method": "GET",
"path": "/reports/campaign_id/email-activity",
"params": {
"fields": "campaign_id,emails.email_address"
},
"operation_id" : "123"
}]
}
Note: You say you'd like to retrieve the campaign_id
field. Please note that the "path" portion of the request already needs to contain the campaign_id
, so you have to have it before you can make this request at all. That said, you might find it valuable to be included in the response so that your processor doesn't have to have information about the request that generated the response.