【问题标题】:GetResponse API intragration with Yii FrameworkGetResponse API 与 Yii 框架的集成
【发布时间】:2017-10-02 13:52:39
【问题描述】:

我有一个 Yii 应用程序,我想将它与 getResponse API 集成。我从github下载了一个getresponsapi.php:https://github.com/GetResponse/getresponse-api-php

我将此文件相应地集成到 Yii,我用 CComponent 扩展了 GetResponse 类,并且我设置了 $api_key = 'https://mywebsite.com/'。

然后在我的一个页面中,我尝试使用以下代码显示所有联系人:

$get_response = new GetResponse('my-api-key-here');
print '<pre>';
print_r($get_response);
print '</pre>';
$contacts = $get_response->getContacts();
print '<pre>';
print_r($contacts);
print '</pre>';

此代码仅返回一个空对象。我不认为这是一个配置错误,因为它会给我一个带有错误代码的 getresponse 错误。

【问题讨论】:

    标签: php yii getresponse


    【解决方案1】:
    $get_response = new GetResponse('my-api-key-here');
    

    您应该将您的 API KEY 放入$get_response

    API KEY 你可以在这里https://app.getresponse.com/manage_api.html

    require_once('GetResponseAPI3.class.php');
    $key_ip = 'PUT_YOUR_KEY_HERE';
    
    $api = new GetResponse($key_ip);
    
    // Connection Testing
    $ping = $api->ping();
    var_dump($ping);
    

    它现在对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-20
      • 2017-01-13
      • 2022-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多