开发者

Facebook Graph API Status update PHP

开发者 https://www.devze.com 2023-01-27 01:27 出处:网络
Ive managed to started working with the Facebook Graph API Ive been able to use javascript to redirect to the permissions allow page where Ive specified \"publish_stream\", Ive received a valid acces

Ive managed to started working with the Facebook Graph API

Ive been able to use javascript to redirect to the permissions allow page where Ive specified "publish_stream", Ive received a valid access_token

I want to update the user's status. Following Facebook's documentation I am attempting to post to:

https://graph.facebook.com/{user_id}/feed/access_token=x&m开发者_如何学Pythonessage=y

(where {user_id} is the user's facebook uid etc)

Ive tried using CURL, as well as file_get_contents so both as POST and GET requests. The only response I received is a list of the user's previous statuses, it will not update the status with the data im sending.

I must be missing something. The documentation says that's all I need


Tell me if you're still having problems with this code as I have a completed version which this computer doesn't have saved on it! Anyhow! One main thing I've notices is the extra '/' in your url:

https://graph.facebook.com/{user_id}/feed/access_token=x&message=y

should be:

https://graph.facebook.com/{user_id}/feed?access_token=x&message=y

and the code that I built from was

curl -F 'access_token=...' \

-F 'message=Hello, Arjun. I like this new API.' \

https://graph.facebook.com/arjun/feed

and I got this code from here.

I hope this helps,

Jon

0

精彩评论

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