【问题标题】:cvent soap api error (php)cvent 肥皂 api 错误 (php)
【发布时间】:2016-12-12 01:00:00
【问题描述】:

我正在尝试使用 php 访问 Cvent soap API 以显示即将发生的事件列表。我发现了这个:https://github.com/gcanivet/php-cvent

当涉及到这个函数时,我得到了“INVALID_CVENT_HEADER_VALUE”:

public function SearchByFilter($objecttype, $type, $filters){   
    $response = $this->client->Search((object) array('ObjectType' => $objecttype, 'CvSearchObject' => (object) array('SearchType' => $type, 'Filter' => $filters)));
    return $response;
}

我已经回显了发送到该函数的内容:

$objecttype = 'Event';
$type = 'AndSearch';
$filters = 

Array
(
    [0] => stdClass Object
        (
            [Field] => EventStartDate
            [Operator] => Greater than
            [Value] => 2016-11-28T00:00:00
        )

)

我所做的只是保存文件,添加我的凭据并尝试回显 $events

$account    = /* my account */
$username   = /* my username */
$password   = /* my password */

require('/templates/home/assets/CventClient.class.php');
$cc = new CventClient();
$cc->Login($account,$username,$password);
$events = $cc->GetUpcomingEvents();

我找到了此文档https://custom.cvent.com/5A44061C587B4DF999B70EC98DCA9A84/files/eb1d01535a124863a290b36fa4cd8bd3.pdf,但我不确定出了什么问题,或者为什么它不起作用。我没有任何使用 SOAP 的经验。任何帮助将不胜感激!

【问题讨论】:

    标签: php api soap


    【解决方案1】:

    var_dump($event)时返回的结果是事件的key。要获得活动的标题,您必须获得 eventId

     `require('/templates/home/assets/CventClient.class.php');
    
     $cc = new CventClient();
    
     $cc->Login($account,$username,$password);
    
     $events = $cc->GetUpcomingEvents();
    
      foreach($events as $event)
        {
        $response = $cc->GetEventById($event);
        //This retrieves the title of all events
         $eventsTitle = $response->EventTitle;
    
         var_dump($eventsTitle );
       }`
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多