开发者

how to create an events in facebook using graph api

开发者 https://www.devze.com 2023-03-14 19:58 出处:网络
I am creating facebook application.I want to create a event.I tried following url but does not work for me.

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

精彩评论

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