Post photo to facebook page with graph API - facebook

I will upload a photo to my page as a page admin. If I use graph explorer it post photo with my account. For example I'm masterweblab on facebook and a page called PAGEMWL. I want upload photo on PAGEMWL's timeline as PAGEMWL. Can you help me?
Update:
When i try to use my app token and get access token to post field facebook return me an error like this:
{
"error": {
"message": "(#200) User must have accepted TOS",
"type": "OAuthException",
"code": 200
}
}

You need to make sure you are uploading the photo with a page token rather than a user token.
Please refer to the documentation for more information.

Related

Post upload in facebook's timeline by Facebook graph API

I'm new in facebook graph API. I easily post upload in FB's pages. But I want to upload in a timeline. But I got an error.
Request :
POST API
https://graph.facebook.com/v3.0/me/photos?access_token=<user_accessToken>&url=https://www.facebook.com/images/fb_icon_325x325.png&caption=Test photo upload
Response :
{
"error": {
"message": "(#200) This endpoint is deprecated since the required permission publish_actions is deprecated",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "A6EzpIcMC9-hZcDlTPA6iPG"
}
}
Please, Explain to me How can I upload a post in the timeline.
Ref., https://developers.facebook.com/docs/graph-api/photo-uploads/
Posting to the user profile is not possible anymore, as the error message tells you. There is no API for it anymore, you can only use the Share Dialog: https://developers.facebook.com/docs/sharing/reference/share-dialog
Changelog with deprecation info: https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#4-24-2018

Permission issue when publish comment with Facebook Graph API v2.12

I am testing the facebook graph API comments
https://developers.facebook.com/docs/graph-api/reference/v2.12/object/comments
I checked my permission for the access token it contains the permission, which required by API. see the screenshot
I test my object-id (1797963943566411_1975256375837166) which is correct see me screenshot
Change the request method to POST and adding post data {"message": "haha"}
I get the error message shows:
"(#3) Publishing comments through the API is only available for page access tokens" see my screenshot
As you can see the first step checking, I have all the permission that the
API required.
Can any one see any sort of error in this process?
Try another way still not work.
I have a user who post a photo on his own facebook page.
I logged in with this user and give this user all permissions see the screenshot
enter image description here
call /me/accounts to get page access token
enter image description here
copy the page access token into the Graph API Explorer's access token field
call
GET: 1797963943566411_1975256375837166/likes
is working fine
But call POST: 1797963943566411_1975256375837166/likes
Get error response:
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "GtEaBfyXrUD"
}
}
The reason is Facebook changed the API behaviour. We are no longer to use api to like any POST on our time line. API can only like or comments on facebook page. Sad face !!!!

not able to get album images from a public album in facebook

I am trying to return all images from a public album and getting this error.
{
"error": {
"message": "Unsupported get request. Object with ID 'TestAlbumOne' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "Ed/iDn/aAVd"
}
}
Which makes no sense since the album does exist and its set to be public. The documentation is also a bit vague since it doesn't really mention anything about the access token in the request url which I did find after some research. Am I missing something here?
request url:
https://graph.facebook.com/v2.8/TestAlbumOne/photos?access_token={'my access token'}
And thats what I see on the facebook album, which does say its a public album
It looks like you are trying to get the public album of a user account, which is impossible without authorizing that specific user with the user_photos permission. Just because stuff is public on facebook.com does not mean you can (or are allowed to) grab it with the API.
Authorize the user with user_photos and use the User Token.
About Tokens in general:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
About user authorization:
https://developers.facebook.com/docs/facebook-login

Facebook Graph API (Post with Photo Ids) - (#10) Application does not have permission for this action

I'm trying to publish a post on my wall with two photos as attachments using Graph API Explorer.
Here's what i did:
I have selected all permissions in my user access token, and am using v2.5.
I have previously uploaded a photo to the endpoint: /me/photo and in response i got its id. i.e. "10154656374686756". This id will remain active for the next 24 hours.
Then I'm passing the photo id as a parameter (that i got in step 2) to my post using endpoint: /me/feed like this:
Graph API Explorer - Post Request
But in response i'm getting the following error instead of the newly created post id:
{
"error": {
"message": "(#10) Application does not have permission for this action",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "BzOCZ1z3tUH"
}
}
I can't figure what i'm doing wrong here. Your help will be much appreciated.

Facebook Graph API | Page feed

I am having a problem with the facebook graph API, when I try to read a Page feed using graph../{pageId}/feed it works only for some pages. On other pages I get the following error:
{
"error": {
"message": "(#200) Requires extended permission: ads_management or manage_pages",
"type": "OAuthException",
"code": 200
}
}
The Page is restricted by location, as we found out in the comments. If it works for one user, most likely the other one is not allowed to view the page - which means that you can´t grab the feed with his User Token. The Page could also be unpublished, but i guess that´s not the case.
If you are unsure, try lifting the restriction and test it.
If that does not work, you should file a bug.