nov / fb_graph

This gem doesn't support FB Graph API v2.0+. Please use fb_graph2 gem instead.
MIT License
1.04k stars 191 forks source link

response of Create event is "FbGraph::InvalidRequest: FbGraph::InvalidRequest" #344

Closed datnt closed 10 years ago

datnt commented 10 years ago

Hi,

Thank you for a great gem.

I'm having issue with create event to facebook:

nov commented 10 years ago

confirm your access token has proper permissions.

datnt commented 10 years ago

Hi,

It was because start_time & end_time format from the example at ReadMe page of fb_graph is not correct. I found this link http://stackoverflow.com/questions/19592144/uncaught-oauthexception-100-invalid-parameter-thrown-while-create-event-in-f In that link, the user name Petra had point me to the right direction. In case someone else have the same issue, here is the code of start_time that works for me.

:start_time => (Time.now+1.hours).strftime("%Y-%m-%d")

nov commented 10 years ago

ah, you are misreading readme. it's

:start_time => 1.week.from_now,
:end_time => 2.week.from_now

not

:start_time => 1.week.from_now.to_i,
:end_time => 2.week.from_now.to_i

ps. (Time.now+1.hours).strftime("%Y-%m-%d") loses hours, minutes and seconds. so it should be different from what you're expecting

datnt commented 10 years ago

Ahh, Thank you.