Cannot create a segment using MailChimp API v3

I use the "playground" to test segment creation, but I continue to receive error checks

my request:

{ "name": "MyTest", "options": { "match": "any", "conditions": [ { "field": "EMAIL", "op": "is", "value": " p001@mymaildomain.xxx " }, { "field": "EMAIL", "op": "is", "value": " p002@mymaildomain.xxx " } ] } } 

answer:

 type: http://kb.mailchimp.com/api/error-docs/400-invalid-resource title: Invalid Resource status: 400 detail: The resource submitted could not be validated. For field-specific details, see the 'errors' array. instance: errors: 0: field: options.conditions.item:0 message: Data did not match any of the schemas described in anyOf. 1: field: options.conditions.item:1 message: Data did not match any of the schemas described in anyOf. 
+5
source share
1 answer

In fact, the JSON format should be as follows:

 { "name":"email based", "options":{ "match": "any", "conditions":[ { "condition_type":"EmailAddress", "field":"merge0", "op":"is", "value":" p001@mymaildomain.xxx " }, { "condition_type":"EmailAddress", "field":"merge0", "op":"is", "value":" p002@mymaildomain.xxx " } ] } 
+6
source

Source: https://habr.com/ru/post/1232548/


All Articles