Error on getting thumbnail_url field with Business Discovery API (Instagram Graph) - facebook-graph-api

I'm trying to get thumbnail_url using Business Discovery API (LINK) and get an error.
Docs says: You can use both nested requests and field expansion to get public fields for a Business or Creator Account's media objects.
In IGMedia docs says: thumbnail_url - Public
So my working request:
{page-id}?fields=business_discovery.username(nike){media{media_url,media_type,children{media_url}}}.
Response:
And, if I add thumbnail_url field in request:
{page-id}?fields=business_discovery.username(nike){media{media_url,media_type,thumbnail_url,children{media_url}}}
Error:
{
"error": {
"message": "(#100) Please read documentation for supported fields.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "A2sUKUDWUyAJjyQErkGjx7b"
}
}
It’s not the end. If I add thumbnail_url in children expansion, from response disappears all CAROUSEL_ALBUM posts.
Request:
{page-id}?fields=business_discovery.username(nike){media{media_url,media_type,children{media_url,thumbnail_url}}}
Response:
So my questions:
Is it a bug (seems like that it)? Or docs are not updated?
Is there other official way to get thumbnail_url using Business Discovery API?
Sorry about long read :)

Related

Instagram API graph stories

First I auth my user, which has role instagram Test Users, got access token by doint request to https://api.instagram.com/oauth/access_token Follow Getting Started guide.
Make a request to get user data https://graph.instagram.com/me?fields=username&access_token={{ACCESS_TOKEN}}
Everything OK, got 200 status and data.
Now tried to follow API Stories Docs
make a request to: https://graph.facebook.com/{{IG_ID}}/stories?access_token={{ACCESS_TOKEN}} (IG_ID is the ID I got from user data request) but doesn't work return invalid access token
{
"error": {
"message": "Invalid OAuth access token - Cannot parse access token",
"type": "OAuthException",
"code": 190,
"fbtrace_id": "{ID}" //im not sure if important to hide
}
}
Now tried to use Explorer Api Graph (Tools->Explorer) I generate an access token (this token is generated with Facebook, not instagram), use this token and the ID (/me in Explorer API) in previous request and the response is:
//https://graph.facebook.com/{{ID}}/stories?access_token={{TOKEN}}
{
"error": {
"message": "(#100) Tried accessing nonexisting field (stories) on node type (User)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "{ID}"
}
}
Maybe I'm misunderstanding the guide, anyone have worked with API?
Hmmm... Does API works with private/public accounts? Or only if account is Business/Content Creator might use this?

API Graph Instagram, Insights, get count likes for user

I want to get the total of like for a user profile, to do this I'm using this endpoint : https://developers.facebook.com/docs/instagram-api/reference/ig-user/insights#lecture:~:text=GET%20/%7Big%2Duser%2Did%7D/insights
I know this metrics is not available in the documentation but when I call the endpoint with a bad metric, the reponse show metrics available and here is the response:
"message": "(#100) metric[0] must be one of the following values: impressions, reach, follower_count,
email_contacts, phone_call_clicks, text_message_clicks, get_directions_clicks, website_clicks,
profile_views, audience_gender_age, audience_locale, audience_country, audience_city, online_followers,
accounts_engaged, total_interactions, likes, comments, shares, saved, replies, engaged_audience_demographics,
reached_audience_demographics, follower_demographics, follows_and_unfollows, profile_links_taps"
https://graph.facebook.com/{ig-user-id}/insights?access_token={access-token}&metric=bad&period=lifetime
As you can see likes is available.
So when I call the endpoint with the metric likes, I get a new error:
"message": "(#100) The following metrics (likes) should be specified with parameter metric_type=total_value"
https://graph.facebook.com/{ig-user-id}/insights?access_token={access-token}&metric=likes&period=lifetime
Then I add the parameter metric_type with value total_value, and I get a new error:
"message": "(#100) Param metric_type on field insights: This param is not valid"
https://graph.facebook.com/{ig-user-id}/insights?access_token={access-token}&metric=likes&period=lifetime&metric_type=total_value
If someone know what i'm doing wrong, it will be a pleasure to get the solution.
Thank's for your responses !

Is it possible that get likes count each facebook pages(not my page)?

I want to gather each facebook pages's total likes.
Not for posts, just page likes.
Is there any access token or some method for getting the information that I want?
I tried this using facebook graph api:
https://graph.facebook.com/v4.0/{page's name ex: uniqlo.kr}/likes
and I get the response:
{
"error": {
"message": "(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "A1LR4IU7npAvTZdHHn-zD_J"
}
}
I think maybe 'uniqlo.kr' is not to be page-id
How can I get page-id that isn't mine?

Can't get page's email using Graph Api

I'm using explorer to test this request "::page_id::?fields=id,name,emails", but it returns this error message:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (emails) on node type (PlaceInformation)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Hzq4cKMXlI1"
}
}
I already tried to use contact_email and user_support_email, but it also didn't work.
What is the right field to get page email?
Take a close look at the error message, it says node type (PlaceInformation). I assume you are trying to use a Place, not a Page. Those are the fields available for Places: https://developers.facebook.com/docs/graph-api/reference/place/

Add Status using Facebook API

I am learning Rest web services using Postman extension of Chrome. I'm practicing it using Facebook API. I have a question about posting in FB.
URI used: https://graph.facebook.com/me/feed?
In the Body of the POST Method, I have given the following Json content
{
"message": "hello",
"access_token": "<a valid token>"
}
I am very sure that my access token is correct as when I append the access token and message with the above URI, the status gets posted successfully. Also when I use it as key-value pairs in 'x-wwww-form-urlencoded' section, it works fine.
But when I try to update the status using the Body of the POST method with the JSON content mentioned above, it tells
{ "error": { "message": "An active access token must be used to query information about the current user.", "type": "OAuthException", "code": 2500 } }
Is there any thing wrong in the format of the JSON content
I missed content-type=application/json
in the Header section.
Adding this solved the problem