[英]mindbody api post CustomClientFields
Im using the API class from Mindbody GetClientServices to access the MindBody Api. 我使用Mindbody GetClientServices的API类来访问MindBody Api。 Works great. 效果很好。
Now i need to add custom values to the client defined in the Mindbody CMS (ie exmployer) 现在,我需要将自定义值添加到Mindbody CMS中定义的客户端(即,雇主)
So this is the array i am using: 所以这是我正在使用的数组:
array('UpdateAction'=>'Update',
'Clients'=>array(
'Client'=>array(
'ID'=>'100015637',
'FirstName'=>'dummy'.$i,
'LastName'=>'Galaxy'.$i,
'BirthDate'=>'2010-05-24T18:13:00', //https://stackoverflow.com/questions/2899332/not-a-valid-allxsd-value
'Username'=> 'helloDummy1'.$i,
'Password'=> 'amin1216$1'.$i,
'Email'=>'dummy'.$i.'@noblestreet.eu',
'EmailOptIn'=> new SoapVar('true', XSD_STRING, 'xsd:boolean'),
'SendEmail'=> new SoapVar('true', XSD_STRING, 'xsd:boolean'),
'MobilePhone'=>'9770534045',
'HomePhone'=>'9770534045',
'WorkPhone'=>'9770534045',
'Address'=>'dummy'.$i,
'Address2'=>'dummy'.$i,
'City'=>'dummy'.$i,
'State'=>'ZH',
'Country'=>'NL',
'PostalCode'=>'2511HA',
'ForeignZip'=>'2511HA',
'Bio'=>'dummy'.$i,
'Status'=>'active',
'CustomClientFields' => array(
'CustomClientField'=> array(
0 => array(
'ID' => '1',
'value'=>'test'
)
)
)
)
)
);
On posting this to the API the customfield doesnt get added and i cant see it in the MB cms. 将其发布到API后,customfield不会被添加,我无法在MB cms中看到它。
Any help on this one? 任何帮助吗?
btw inserting/updating other values works 顺便说一句插入/更新其他值的作品
The comment made by Yuga was the correct answer: Yuga发表的评论是正确的答案:
1) Post resulting XML request you're sending to Mindbody API. 1)将您要发送的结果XML请求发布到Mindbody API。
2) Try comparing your XML to the example XML updating custom fields shown on https://developers.mindbodyonline.com/Develop/ClientService . 2)尝试将XML与https://developers.mindbodyonline.com/Develop/ClientService上显示的示例XML更新自定义字段进行比较。
3) Which XML response do you get? 3)您得到哪个XML响应? You may get an error, I suppose. 我想您可能会出错。
4) Most probably you need to send 'Value' not 'value'. 4)最有可能您需要发送“值”而不是“值”。
5) Make sure you send
<Fields><string>Clients.CustomClientFields</string></Fields>
in your XML request 5)确保在XML请求中发送<Fields><string>Clients.CustomClientFields</string></Fields>
Point 4 (correcting the typo value
to Value
) solved my problem. 第4点(将错字value
校正为Value
)解决了我的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.