不工作GETRESPONSE API通讯 [英] Getresponse API newsletter not working

查看:161
本文介绍了不工作GETRESPONSE API通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过API发送的GetResponse通讯。预期它不工作。我也跟着
https://github.com/GetResponse/DevZone/tree/master/API#send_newsletter

I have tried to send getresponse newsletter through API. Its not working as expected. i have followed the https://github.com/GetResponse/DevZone/tree/master/API#send_newsletter

在这里,code http://pastebin.com/tWWKgpF5

我不太确定这是不对的。

I'm not so sure which is wrong.

推荐答案

终于得偿所愿。它可能是有用的。你可以找到很多例子中的https://github.com/robertstaddon/GetResponse-PHP-Wrapper/blob/master/PHPwrapper/examples.php

Finally Got it. It may be useful. YOu can find lots of example https://github.com/robertstaddon/GetResponse-PHP-Wrapper/blob/master/PHPwrapper/examples.php

 <?php
 # Demonstrates how to sending newsletter to campaign.

 # JSON::RPC module is required
 # available at http://github.com/GetResponse/DevZone/blob/master/API/lib  /jsonRPCClient.php
 require_once 'jsonRPCClient.php';

# your API key is available at
# https://app.getresponse.com/my_api_key.html

$api_key = 'APIKEY';

# API 2.x URL
$api_url = 'http://api2.getresponse.com';

# initialize JSON-RPC client
$client = new jsonRPCClient($api_url);

# find campaign named 'test'
$campaigns = $client->get_campaigns(
$api_key,
array (
    # find by name literally
    'name' => array ( 'EQUALS' => '<enter your campaign name>' )
)
 );

# uncomment following line to preview Response
print_r($campaigns);

# because there can be only one campaign of this name
# first key is the CAMPAIGN_ID required by next method
# (this ID is constant and should be cached for future use)

$CAMPAIGN_ID = array_pop(array_keys($campaigns));

$contact_id = array('p3WW','PEU'); // Find the contact ID by using email ID and form as array like this.

 $body   = "Newsletter message. we can send any HTML";

 # Sending Newsletter to the campaign
 $result = $client->send_newsletter(
$api_key,
array (


    "campaign"      => $CAMPAIGN_ID,
        "from_field"       => "<Find the From ID>", // To find it . Use this $accountDetails = $api->getAccountFromFields();
        "reply_to_field"   => "<Find the From ID>", // To find it . Use this $accountDetails = $api->getAccountFromFields();
        "subject"  => "Subject of the Newsletter",
        "name"     =>"Any Name",    
          "contacts"    => $contact_id,   

'contents' => array(
 'html'       => $body 
 )
 )

 );




 ?>

这篇关于不工作GETRESPONSE API通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆