I’m trying to optout 100 emails in a batch request
MIXED_REQUEST_DENIED, Message: only one product type is supported in one batched request
I am in fact only using WEB_OPTOUT and not mixing anything. Is the error referring to something else? I thought I was following the documentation for optout–what’s the correct approach? Thanks.
Here’s my Python code for reference:
oauth_header = ...
post_data = [
{
'operation_type': 'Update',
'params': {
'membership_type': 'WEB_OPTOUT',
'user_identifier': hash_id(email),
'user_identifier_type': 'EMAIL',
'effective_at': datetime.datetime.utcnow().strftime(ISO8601_WITH_Z)
}
} for email in emails
]
res = requests.post(
'https://ads-api.twitter.com/3/tailored_audience_memberships',
headers={
'content-type': 'application/json',
'Host': 'ads-api.twitter.com'
},
auth=oauth_header,
json=post_data,
)