2015-09-29 22 views
5

Ben bir segment yaratan test etmek için "oyun alanı" kullanıyorum kullanarak parçası oluşturulamadı ama almaya devam doğrulamaları errrosMailChimp API v3

ricam:

{ 
    "name": "MyTest", 
    "options": { 
     "match": "any", 
     "conditions": [ 
      { 
       "field": "EMAIL", 
       "op": "is", 
       "value": "[email protected]" 
      }, 
      { 
       "field": "EMAIL", 
       "op": "is", 
       "value": "[email protected]" 
      } 
     ] 
    } 
} 

yanıttır:

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. 
+0

Bu bana doğru görünüyor; Tam sorguyu şimdi kendi hesabımda denedim ve işe yaradı - belki sorun çözüldü mü? – TooMuchPete

+0

@Hans: Mailchimp playgroung'da segment oluşturma işlemini nasıl test edeceğinizi söyler misiniz? Aynı problemle karşı karşıyayım ama farklı birleştirme alanına sahibim (örneğin, Tip). Sorunumu öğrenmek için bana yardımcı olabilir misiniz? Lütfen sorularımın üzerine bir bakın - http://stackoverflow.com/questions/41465345/issue-when-requsting-create-segments-api-v3-through-php-wrapper | Github - https://github.com/drewm/mailchimp-api/issues/160 –

cevap

6

Aslında JSON'un biçimi aşağıdaki gibi olmalıdır:

{ 
    "name":"email based", 
    "options":{ 
       "match": "any", 
       "conditions":[ 
           { 
            "condition_type":"EmailAddress", 
            "field":"merge0", 
            "op":"is", 
            "value":"[email protected]" 
           }, 
           { 
            "condition_type":"EmailAddress", 
            "field":"merge0", 
            "op":"is", 
            "value":"[email protected]" 
           } 
       ] 
    } 
+1

Sadece alanın değerinin ya birleştirme ya da EMAIL olabileceğini belirtmek için. – codebusta

+0

Teşekkür ederim, bir gün deneme yanılma testi ile test ediyorum. Not. Ben işe yaramadı EMAIL kullanıyordum ve bir cazibe gibi çalıştım teşekkürler) – xiarnousx

+0

Bir şey değil, sizi biraz zaman ve sinirler kurtardı sevindim;) – codebusta