How to publish Facebook post link+picture without this #100 error? - facebook-graph-api

I have some working code which is posting in a facebook page feed a link + message/caption.
This is working fine.
When I add the picture field which is one image url in my domain I get response error
{
"error": {
"message": "(#100) Only owners of the URL have the ability to specify the picture, name, thumbnail or description params.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "dfaafdadfs\/Ie6"
}
}
Let us consider the domain is example.com
I have already verified this domain in facebook business manager via DNS TXT entry lookup.
Also I have added the page app under this domain.
I don't know what is wrong here.
The failing request is something like this
POST /myPageId/feed?access_token=at&link=https://example.com/somepath&message=somemessage=picture=https://example.com/images/someimage.jpg
If I remove picture parameter posting works fine without the error.
Any input here? The link without a picture does not get any attention or impressions so we want to publish the image as well.
PS:
The documentation in facebook is located at
https://developers.facebook.com/docs/graph-api/reference/v15.0/page/feed
and this section (no hash available so you need to scroll down to see the first screenshoot)
This second image was found at another page in fb site. Neither of them work with picture. Again I have added and verified my example.com example domain under business manager. Both the link + image url are from example.com domain.

Related

Facebook Graph API has stopped working for photos

I'm using https://graph.facebook.com/{page-id}/photos but looks like it has stopped working correctly in UI.
The endpoint returns the response with publication ID, but the photo is not shown on the Page. I can only see the uploaded photo from inside my admin account, which means the uploaded photo is not publicly available.
Example:
POST request example:
https://graph.facebook.com/{page-id}/photos?access_token=...
Body:
caption=text
ulr=photo url
no_story=false
published=true
the response:
{
"id": "6851823568176784",
"post_id": "132553756770499_6851823568176784"
}
Even if I use GET for https://graph.facebook.com/{page-id}/photos it shows the recently uploaded photo. However, Page still doesn't have it.
I even posted a bug to Developers Platform: https://developers.facebook.com/support/bugs/986155901938240/
However, the response was: From backend, I can confirm that both photos are created properly (since these were id returned). This seems to be an Facebook.com UI issue.
Has anyone also spotted this?

How can I post content to an app users page, linking to their website, from an app running on my website?

I am creating an app for a client that allows their clients to schedule posts and post to facebook from the app.
Clients log into my-domain and the app requests permissions to post to their pages. I am fine with getting a list of pages from facebook and requesting the pages_read_engagement and pages_manage_posts permissions.
My app needs to allow users to select an image (hosted on my-domain) and post that with a link that points at their-domain, along with the post content. Here is an example of an api call I am making using the Javascript SDK (from my app at my-domain):
FB.api('/' + page_id + '/feed', 'POST', {
message: post.content,
link: user.website,
picture: image.url,
access_token: page_access_token
}, () => {})
I get back an error:
(#100) Only owners of the URL have the ability to specify the picture, name, thumbnail or description params.
I have had a read through the domain verification docs but I don't understand what I need to do next. Do all of my users have to verify their own domain via DNS verification? Is there a way for me to allow users to post to their own pages, linking to their websites, from my app, without them having to do anything technical? Am I missing something?

Instagram API media endpoint giving null results

I have a requirement where i need to get all the images tagged at a given location in Instagram.
For this i am trying to use the Instagram API with Media Endpoint as described in the link https://www.instagram.com/developer/endpoints/media/.
I use the following API URL to get the media information.
https://api.instagram.com/v1/media/search?lat=48.858844&lng=2.294351&access_token=
But the result is displayed as {"meta": {"code": 200}, "data": []}
The result is displayed same for any location co-ordinates.
The access key is valid and i get the result for location endpoints
You probably are in Sandbox mode https://www.instagram.com/developer/sandbox/
You will only see your photos and your sandbox users in results, try searching for a location that you have posted a photo and only that will show in results, once your app is reviewed and live, all results will show up.
The behavior of the API when you are in sandbox mode is the same as
when your app is live, but comes with the following restrictions:
Data is restricted to sandbox users and the 20 most recent media from each sandbox user
Reduced API rate limits

Get comments of public facebook post

I'm trying to download every comment on a public facebook post (it's one of those "can you do this basic algebra problem" posts - I want to see what percent of the comments get it right).
The Graph API Reference shows that I should be able to just GET graph.facebook.com/v2.5/{object-id}/comments.
I believe the object-id of this post is {user-id}_{post-id}, where post-id is the id in the url. So given this url:
https://www.facebook.com/beth.mansfield.9/posts/10207885721596563
The user-id of facebook.com/beth.mansfield.9 is 1101752663 (from findmyfbid.com), and the post-id is 10207885721596563 (from the url), which makes the object-id="1101752663_10207885721596563".
When I try graph.facebook.com/v2.5/1101752663_10207885721596563/comments in the Graph API Explorer, though, I get:
{
"data": [
]
}
What am I doing wrong? Is there another way to get the comments? There are close to a million so loading them all in the browser and scraping with javascript would be unfeasible.
That is a user profile. You can only get data of a user profile if that specific user authorized your App. In that case, you would need to authorize with the user_posts permission. Just because it is public, does not mean you can get the data - that would only work for Pages.

Unable to retrieve data from facebook graph url for a page

Check out:
https://www.facebook.com/MitraJyothiorg
It is a page of an NGO.
Correspondingly, I should be able to find data of the page in:
http://graph.facebook.com/MitraJyothiorg
This does not seem to work. Any clues?
Please note: I am doing a simple http call and it usually works for other pages, for example, if i do the same thing for another page:teachforindia
The error message is quite clear:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
You need to add at least an App Access Token. See
https://developers.facebook.com/docs/graph-api/reference/page#Reading
For pages that are published, you need:
An app or user access token is needed to view fields from fully public pages.
A user access token is needed to view fields from restricted pages that this person is able to view (such as those restrict to certain demographics like location or age, or those only viewable by Page admins).
A page access token can also be used to view those restricted fields.
I am not able to access that page (get a 404 error). Maybe the page is still hidden? Then you will not be able to access it via the graph API imho.