已在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