已在API上使用此示例创建组。以PHP返回值的API
$response = $soap->createGroup(
array(
'api_key'=> $api_key,
'group_name'=> 'Fred'
)
);
这个效果很好。然而。我需要让API返回组ID。该API表示,以下
createGroup
- Usage: Used to create a group that a recipient can be placed in.
- Return: The id of the created group, used in such functions as addRecipient
- Parameters
o group_name (required), your reference to the group, e.g. ‘Group 1’
o add_recipients (optional), the id or an array of existing recipient ids to add to this group, see
addRecipient
我怎样才能做到这一点在PHP,这样我可以添加必要的收件人到这个组,尝试添加收件人需要以下时。
addRecipient
- Usage: Used to add a recipient to your account
- Return: The id of the added recipient
- Parameters
o email (required), the recipients email address
o name (optional), the recipient's name
o group (optional), id of an existing group, see createGroup.
它需要组ID而不是名称。
非常感谢您的帮助,因为这一直困扰着我。
Louk
是什么'$ response'是什么样子?组ID应该在那。 – 2014-10-16 21:52:49
我试着回应它并得到这个'可捕捉的致命错误:类stdClass的对象无法转换为字符串/var/www/vhosts/icanpromo.co.uk/httpdocs/API/Add.php 31行' – 2014-10-16 21:59:15
使用print_r($ response)代替 – 2014-10-16 22:00:26