Search code examples
phpwsdl

How to pass dates to Abila/Avectra netForum using PHP?


I have credentials to access Abila netForum xWeb functions. I am using PHP to do so. What I need to do is get a list of all events. I am trying to use GetActiveEventListByDate()

I am able to authenticate just fine - got the Authenticate Token and SignOn Token from the SignOn WSDL. Got the Authenticate Token from netFORUMXMLOnDemand WSDL as well.

Then, I am trying to get all events by passing the date range to netFORUMXMLOnDemand WSDL - and that does not work for some reason. I think it is probably the date format but no matter what I try it does not work.

I tried:

$requestParams = array('EventStartDate' => '1/1/2000', 'EventEndDate' => '5/10/2017', 'bActiveOnly' => 1);
$result = $client_netforum->GetActiveEventListByDate($requestParams);
print_r($result);

I tried different time formats but nothing works. Tried adding hours:minutes:seconds, tried converting date to ISO 8601...

$start = new DateTime("2014-12-12 11:11:11");
$start = $start->format("Y-m-d H:i:s e");
$end = new DateTime("2018-12-12 11:11:11");
$end = $end->format("Y-m-d H:i:s e");

$start = gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 2016));
$end = gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 2018));

$start = new DateTime('2014-12-12 11:11:11');
$start = $start->format(DateTime::W3C);
$end = new DateTime('2019-12-12 11:11:11');
$end = $end->format(DateTime::W3C);

$requestParams = array('EventStartDate' => $start, 'EventEndDate' => $end, 'bActiveOnly' => 1);

Some other functions are working fine, I tested the GetEventByKey() with a known event key and it all worked fine.

Any help is appreciated.


EDIT 06/05/2017

OK, making some progress here, it seems that the date formatting is not the issue here, some dates are working fine but not all of them. Abila is no help, it's like pulling teeth with those guys.

I am using this page as a reference: https://uat.netforumpro.com/iweb/help/api/GetActiveEventListByDate.htm and even though they say that some fields are optional here, they don't seem to be - getting no results.

So, for example, this works fine:

$requestParams6 = array('EventStartDate' => '1/28/2017', 'EventEndDate' => '12/12/2027', 'bActiveOnly' => false, 'szRecordDate' => '02/24/2016');
$result6 = $client_netforum->GetActiveEventListByDate($requestParams6);

But if I change EventStartDate to '5/23/2017', it no longer works - no results returned.

$requestParams6 = array('EventStartDate' => '5/23/2017', 'EventEndDate' => '12/12/2027', 'bActiveOnly' => false, 'szRecordDate' => '02/24/2016');
$result6 = $client_netforum->GetActiveEventListByDate($requestParams6);

How do I determine exactly which dates to use here?

Also, what does szRecordDate field stands for? Changing it to some other date messes up the results as well - nothing returned!

Again, any help is appreciated.


Solution

  • Sorry all, at the end, it was not the date issue at all. I am posting this in case someone has the same issue.

    The problem was some illegal character in an event title in my date range. For some reason, if you encounter an illegal character while trying to access the list, you are gonna get a silent error - no results displayed.

    It took Abila people a few weeks to figure this one out.

    Hope this helps someone.