Post a link to a Facebook Application page with an application access token - facebook

I've been trying to get my Django application to post all new news stories to the application's facebook page. It works posting to /feed, but if I try to post to /links with the access token given like this, I get the following error:
facebook.GraphAPIError: (#282) Requires extended permission: share_item
Surely I should be able to post to the application page of my application using this access token? What am I doing wrong?

Hi Ben i got the same error , but i didnt understand what is wrong, i use php curl to post data to my facebook page, i have token and it says i have permisson to share item but i cant.
what should i do ?
that was my question and finaly i solved it.
Even if you have the permissons you have to have an extended permisson like "manage_page" so to get this, you should enter this url :
https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=manage_pages&response_type=token
and than no errors ;)

After looking through the code in the Python-SDK for Facebook, I worked this out: you have to use the put_wall_post function with the link supplied in a dictionary as shown in the source.
I hope this helps someone in the future!

Related

Getting Stream from Facebook page with neosmart

Im using neosmart jquery plugin to get streams from facebook to my own page.
The plugin requires the page id from the fanpage, and mostly its working ok.
But with the link https://www.facebook.com/midtfynsgymnasium i cant get anything.
I guess the page id is 121130641250864 but i cant get the data. Is it because they have put on a "noread" attribute ?
The Facebook ID is only the last part of your address: https://neosmart-stream.de/facebook/how-to-find-a-facebook-id/
Additionally your access token needs the permission read_stream.

Stuck with Facebook like box for months

Never had such problems with any of the software in my life.
I have a facebook page http://www.facebook.com/zelife.ru
and all the time I try to create a likebox code for inserting it on my web-site I see this:
"Could not retrieve id for the specified page. Please verify correct href was passed in."
As far as I understand, I need to get an ID, where should I get it?
Thanks in advance.
Art
The facebook like-box is designed for facebook pages only! You are trying to use your profile, that's why you're getting an error.

Strange Access Token returned from Facebook

I have been working on Facebook app and I have been using Facebook Graph Toolkit for months and all the while, MY CODES are working (I can get Access Token, and I can use them to retrieve Facebook user details, publish news feed, etc)
Now, there's new problem arise that I never expect it to happen and didn't know what is wrong with Facebook!
I have been following my old set of codes and discovered that Facebook now returns back Access Token that is not in this format (which is the correct format all the while I'm using, it is even the same format found in this page
|c4e304f814362ec6b6dd823a.1-|LeRzWafqGjfriGabNmmOU4U07Pw
Now, I've been getting the format like this
AAABddZAETAbYBAKNESQCdiZC2ojQOjSAIHfFCBFtn99wUYC448po2FN4VrvempAQVnUaBwJb9Qxwg6j9uegLZAeaZA4vmh503bHkUIsj1hIl1ZCvCbZBkz&expires=6204
Anyone knows what happen??
This is the new style access_token. You can see it working by visiting this link:
https://graph.facebook.com/me?access_token={access_token from your question}
This change has been advertised on the Facebook dev blog:
https://developers.facebook.com/blog/post/497/
...
https://developers.facebook.com/blog/post/555/
I can't, however, yet answer why the style of the access_token has changed, because the documentation hasn't been updated yet to show this change: https://developers.facebook.com/docs/authentication/
Note: I suggest you remove the access_token from your question, as it means others are able to access your data!
This looks to be the new encrypted access token that Facebook is moving to. Will probably be the norm. If you were previously parsing it for different bit's of info you'll probably need to change to decoding it.

How to post a COMMENT with FB application profile photo?

It is possible for a 'facebook application' to post a COMMENT on a POST when there is a valid ACCESS_TOKEN. API call for the same is: /xyz_profile_id/comments/?access_token=...
ACCESS_TOKEN being generated by allowing the "facebook application" to get access to xyz_profile_id. The post done will have default FROM ID as xyz_profile_id showing his/her profile photo along with the comment.
My requirement is this: How to change the FROM ID as appilcation_id so that the profile photo of the application is shown beside the posted comment.
Can you please provide more information on what you are doing and how you are doing it. Not sure about 'FROM ID as application_id' requirement.
E.g. posting comment to a post:
https://graph.facebook.com/<post_id>/comments?access_token=<token>&method=post&message=hi
will generate a story like this:
How do you want to change this?
In this case, you will need to authenticate your session with an application access_token, as opposed to a user access_token. Make sure the application has been installed on that particular page you want to update comments on.
Read more: http://developers.facebook.com/docs/authentication/

facebook api access a page's photo album

So really what i would like to do is access my page's photos albums to include them into my own website. So i can upload to facebook and have that viewable on my own site.
I using the php skd but fql would be better for this as i can easily get a JSON object back and i believe i wouldn't need to use the sdk as this is for user's informtaion not a pages details.
So does anybody have ideas on this?
url i'm trying to access the query:
https://api.facebook.com/method/fql.query?query=SELECT%20name%20FROM%20album%20Where%20aid=%27118818791532414%27&format=JSON
Page i am taking the photos from:
www.facebook.com/mayfieldathleticfc
Album i am using as an example:
http://www.facebook.com/media/set/?set=a.118818791532414.24873.118816378199322
I thought maybe i hadn't set the photos to public but after closer inspection i don't believe you can do this?
Anyway thoughts are welcome =)
That URL returns to you an informative error message:
{"error_code":102,"error_msg":"Session key invalid or no longer valid",
"request_args":[{"key":"method","value":"fql.query"},
{"key":"query","value":"SELECT name FROM album Where aid='118818791532414'"},
{"key":"format","value":"JSON"}]}
To call Facebook APIs, you have to pass in a session key - even to access 'public' things. A good starting point for learning how to authenticate and get a session key is http://developers.facebook.com/docs/authentication/
After a little more routing around i realised that it was my id's and owners details that was not correct: api.facebook.com/method/… i had this sorted it worked.