开发者

how to create an events in facebook using graph api

I am creating facebook application.I want to create a event.I tried following url but does not work for me. https://graph.facebook.com/profileid/events?access_token=generatedaccess_token&name=somename&location=locationname I am getting json output with blank data.There is nothing in data tag.When I adding method=post,gives me error sa开发者_Python百科ying that invalid parameter.


In order to create an event, you have to issue an HTTP POST request. This is straight from the facebook graph api documentation: http://developers.facebook.com/docs/reference/api/page/#events

An HTTP POST request is basically like submitting a form with method="post". You can use cURL to do this fairly easily:

curl \
    –F 'access_token=[PAGE_ACCESS_TOKEN]' \
    -F 'batch=[ \
          { "method": "POST", \
            "relative_url": "[PAGE_ID]/events", \
            "body": "name=[EVENT_NAME]&start_time=[UNIX_TIMESTAMP]" \
          }, \
        ]'\
    https://graph.facebook.com

You can refer to the section on batch request for more help on this: http://developers.facebook.com/docs/reference/api/batch/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜