oklahomer / p5-Facebook-OpenGraph

Home Page:https://metacpan.org/release/Facebook-OpenGraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

colon in datetime results in error

brunnock opened this issue · comments

Using Facebook::OpenGraph v1.22 .

The following code works for me-

use Facebook::OpenGraph();

my $fb = Facebook::OpenGraph->new(+{
app_id => XXX,
secret => 'YYY'
});

$fb->set_access_token('reallylongstring');

$fb->post('/page_id/events',
+{name => 'Test Event 1',
start_time => '2014-05-22',
});

If I change start_time to include the time (eg '2014-05-22T12:00'),
then I get the following error-

100:- OAuthException:(#100) Invalid parameter

I'm guessing it's due to the colon being escaped to "%3A" in the time.

I looked up the document and it says we can set date-only or precise-time. Acceptable format is shown in the picture below. So if you try to specify time as you said, you must set start_at in the form of 2012-07-04T19:00:00-0700.

758f537165bfc5fc15d0959b244915be

I created a test user and tested with my own app. When I set 2014-05-22 or 2014-05-22T12:00:00-0700 it successfully created event.
When I set 2014-05-22T12:00, it failed.

I hope it helps you, @brunnock.