cvent soap api error(php)

时间:2016-12-12 01:00:00

标签: php api soap

我尝试使用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经验。任何帮助将不胜感激!!

1 个答案:

答案 0 :(得分:2)

var_dump($event)是事件的键时返回的结果。要获得活动的标题,您必须获得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 );
   }`