How to get Instagram profile data and media, from non Business/Creator Instagram account with Business Discovery API? - facebook-graph-api

I'm trying to get Instagram profile data, and media using Business Discovery API, but in some cases i get an error.
For example: try to get data from this profile https://www.instagram.com/luxurycars2627/.
Request:
{FACEBOOK_API_URL}{ig-user-id}?fields=business_discovery.username(luxurycars2627){media{caption,comments_count,like_count,media_url,username,timestamp,permalink,children{media_url}}}
And response:
{
"error": {
"message": "Invalid user id",
"type": "OAuthException",
"code": 110,
"error_subcode": 2207013,
"is_transient": false,
"error_user_title": "Не удалось найти пользователя",
"error_user_msg": "Не удалось найти человека с именем пользователя luxurycars2627.",
"fbtrace_id": "AFErRS2FXb8ZYM66u-2zfIV"
}
}
error_user_msg - Could not find a person with the username luxurycars2627.
So, i don't understand why i getting this error. Profile is not closed, and exists. I don't know, is that profile business or creator. In my app need to get data and media from any profiles.
Maybe Business Discovery API working with only business and creators profile, so if that's it, how can i get profile data and media from non creator or business profile?
Thanx!

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?

facebook graph api get_started button issue

At a facebook page, where i am not an admin, subscribed to my facebook app, which is a chatbot. Altough the chatbot functioning already, i cannot setup the get_started button with the following call:
https://graph.facebook.com/v5.0/me/messenger_profile?access_token=theaccesstoken
{
"get_started":{
"payload":"GET_STARTED_PAYLOAD"
}
}
it works for the pages i am admin of, but for this page i get the following response:
"error": {
"message": "(#200) User does not have sufficient administrative permission for this action on this page. If the page business requires Two Factor Authentication, the user also needs to enable Two Factor Authentication.",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "44323423423423"
}
}
the access token has the followiing permissions for the page:
email, manage_pages, pages_show_list, read_page_mailboxes, pages_messaging, public_profile
the token did not expire
Can some explain please what should be done differently?
[UPDATE]
The problem occured because the user was not a page admin, just an editor.

Zomato - Menu fetch API (/dailymenu)

When i use Zomato API to fetch Menu(/dailymenu), its always returning the below response.
{
"code": 400,
"status": "Bad Request",
"message": "No Daily Menu Available"
}
Anyone had any luck with this?
I believe Zomato is not exposing Menu Data.
I was trying for the city of Dubai.
Daily menu is supported in Prague, Czech Republic only and not in any other city where Zomato is present.

How to publish a new post to facebook wall?

My app have been approved for publish_actions permission and I want to publish to user's wall behave my user. I tried to call the graph API like this:
https://graph.facebook.com/v2.7/me/feed?access_token=<token>&method=post&message=Hello
I read the facebook documents and It says A user access token with publish_actions permission can be used to publish new posts.
But actually I can't publish the message to user's wall. What I receive is:
{
"error": {
"message": "Invalid OAuth 2.0 Access Token",
"type": "FacebookApiException",
"code": 190,
"error_subcode": 1732004,
"is_transient": false,
"error_user_title": "Invalid Access Token",
"error_user_msg": "Invalid access token received.",
"fbtrace_id": "<trace code here>"
}
}
Do I make any mistake?
Update: Add screenshot of my token debugger information
This worked fine for me: https://graph.facebook.com/me/feed?access_token=xxx&method=post&message=test
Make sure the Access Token is valid and includes the publish_actions permission, you can test it here: https://developers.facebook.com/tools/debug/access_token/

"You must be a developer of the application" while accessing unified_thread

I get this response each time I want to access my chat history with a user:
{
"error": {
"message": "(#298) You must be a developer of the application",
"type": "OAuthException",
"code": 298
}
}
The FQL query I use:
SELECT message_id, sender, body
FROM unified_message
WHERE thread_id IN
(SELECT thread_id FROM unified_thread WHERE single_recipient = 'XXXX')
ORDER BY timestamp desc;
The tool I use:
Facebook Graph Explorer
The token I use:
app: my app
user: a non-developer account
My app settings:
marked as "Live and available to all users"
From what I've read, unified_thread was once restricted to developer accounts as it was being deployed by facebook, but today any doc says that we can use this table.
If I switch to a token with a developer account, it works of course.
Are there some restrictions to use these tables I'm not aware of?