Looking to add tags to my mailing list members via the api. But I don't see where to pass in tags in the documentation. Can someone point to an example of how to update the tags associated with a member via the api?
Tags replaced static segments. So, the endpoints used to create tags and add and remove tags from members are the same endpoints that were previously used to manage segments. Here is the documentation on the endpoints to use to manage your tags via the API that includes the request and response body parameters as well as example requests and responses:
http://developer.mailchimp.com/documentation/mailchimp/reference/lists/segments/
In order to add tags to your members, you need to include their email addresses in the 'static_segment' array parameter.
I hope that helps.
If you want to create a member AND add a tag while doing so you may specify the tag attribute the following way:
$data = array( 'apikey' => $api_key, 'email_address' => $email, 'status' => $status, 'tags' => array('your-tag-name'), 'merge_fields' => array( 'FNAME' => $fname, 'LNAME' => $lname ) );
Even though MC API some places will tell you to fill out both a name and a status, it helped me to define tags as an array but ONLY pasting in the name of the tag.
Seefan's answer in this thread helped me out and I figured i wanted to help a person who spend days (like me) to figure out how the "tags" is specified: add tags to mailchimp subscriber created via api php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With