Instagram Basic Display, exchange token error on live - instagram-graph-api

instagram_graph_user_profile and instagram_graph_user_media are approved but the check mark under Products -> Instagram is not green. Business is verified.
Instagram test users work fine!
We don't have instagram_basic permissions, but as we understand it we won't need it since we don't want do access the facebook graph api (instagram-media or instagram-comment), only the instagram basic display api.
We can get a short-lived access token but the get request to https://graph.instagram.com/access_token?grant_type=ig_exchange_token results in {'error': {'message': 'Unsupported get request.', 'code': 100, 'type': u'IGApiException', 'fbtrace_id': u'AJB2dj8osRQbYgG6kNtlmYt'}}
What's going on?

Related

My app is not able to send message to Teams channel using graph api

I am trying to send message to teams channel using graph api. I am able to send the messages using my personal(user) tokens but not able to do it using an app which I have registered in Azure portal. My app also got access to protected apis from Microsft Teams.
Attaching the screen shot of app permissions and code snippet on how I am getting tokens.
app permissions
Code snippet to get tokens
One thing I noticed, when I decoded the the tokens I am getting, that roles in tokens only shows application permissions("Teamwork.Migrate.All") and it doesn't show delegated permissions("ChannelMessage.Read.All","ChannelMessage.Send","Teamwork.Migrate.All").
Below are the error message I am getting.
While doing get request to https://graph.microsoft.com/v1.0/teams/{teams_id}/channels/{channel_id}/messages
one of 'ChannelMessage.Read.All' or 'ChannelMessage.Read.Group' when using resont. Roles on the request 'Teamwork.Migrate.All' and resource specific consent g request ''", 'innerError': {'date': '2021-07-04T14:27:41', 'request-id': '8c1f-e345bf15da7b', 'client-request-id': '8c1fffc2-c94d-4d5b-a81d-e345bf15da7b'}}}
While doing post request to https://graph.microsoft.com/v1.0/teams/{teams_id}/channels/{channel_id}/messages/{message-id}/replies
{'error': {'code': 'Unauthorized', 'message': 'Unauthorized', 'innerError': {'d4:26:47', 'request-id': '44fe99be-1ed8-4505-a3e7-a88ce934e3f8', 'client-request8-4505-a3e7-a88ce934e3f8'}}}
You are currently using Get access without a user(Application permission). Application permissions are only supported for migration. Instead you should try delegated flow: Get access on behalf of a user. Please go though the documentation and you can try it using Postman or Fiddler.
You can also try Get started with Microsoft Graph and Python tutorial which shows fetching calendar information using Graph APIs.

Slack API Opening a New DM (Scopes and Permissions)

I am attempting to open a DM (Direct Message) with an arbitrary user using the im.open Slack API call. I am sending it a user's user_id that I obtain through their clicking of a consent button in order to begin a series of questions. I am sending data to the Slack API successfully along with receiving data. I am getting the following response...
{
"ok": false,
"error": "missing_scope",
"needed": "im:write",
"provided": "identify,incoming-webhook,chat:write:user,files:write:user",
}
I have went into the application's page and changed the scope of the app (I am not the owner, but have been given collaborator permissions by my team lead (the owner)). These are the current permissions...
I apologize for the poor quality of the image. The scopes are as follows...
identify
incoming-webhook
chat:write:user
files:write:user
im:write
After this change, I am still getting the same response from the Slack API. The following is what I am sending them (it's my user_id, and I don't mind).
{
"user": "U94155Z43"
}
Any help is appreciated. Thanks.
I needed to use the bot token "xoxb" instead of the user token "xoxp" which I had used for all other slack api calls.

Facebook API App Access Token

I've been using for many years my FACEBOOK_APP_ID|FACEBOOK_APP_SECRET as an app access token for accessing the facebook API, but lately it seems to be giving me not up to date data.
For example, on this page:
https://www.facebook.com/pg/Vallagruppen/posts
If I just view in the graph explorer with the default access tokens, I get the correct results:
https://developers.facebook.com/tools/explorer/?method=GET&path=Vallagruppen%2Fposts&version=v2.11
But if I change the access token in the explorer to one like above, with an APP_ID|APP_SECRET I am suddenly not getting all the posts, the newest few are not showing up.
Additionally it will say: "Access Token Info Warning Failed to debug token"
Any idea why?

Getting an invalid_scope for youtube.upload device code request

I am trying to use the Youtube data API from an app, and I'd like to just request permission to upload videos, not to manage their entire Youtube account.
When I try to request an access token for the scope https://www.googleapis.com/auth/youtube.upload, I get back an error saying it is an invalid scope. I've given the app permission to the Youtube v3 data API.
According to the v3 youtube docs, these are the supported scopes:
https://www.googleapis.com/auth/youtube - Manage your YouTube account.
https://www.googleapis.com/auth/youtube.readonly - View your YouTube account.
https://www.googleapis.com/auth/youtube.upload - Upload YouTube videos and manage your YouTube videos.
The only one of these 3 that works for me is "https://www.googleapis.com/auth/youtube".
This is the request I am attempting:
curl -d "client_id=id&scope=https://www.googleapis.com/auth/youtube.upload" https://accounts.google.com/o/oauth2/device/code
And this is the response:
{
"error" : "invalid_scope",
"error_description" : "Not authorized to request the scopes: [https://www.googleapis.com/auth/youtube.upload]",
"error_uri" : "http://code.google.com/apis/accounts/docs/OAuth2.html"
}
I am thinking that maybe this type of request just doesn't work for device codes? The youtube.upload scope request seems to work fine in the oauth2 playground.
Update: This issue has been fixed.
This scope by itself was not whitelisted for the devices. Filed a request internally.
On the other hand, as explained here, Stackoverflow is for programming questions, you can use public issue tracker for bug reports or feature requests.
Feel free to file a bug report in issue tracker to get updated on this issue.

Can we grant access to an app to post something on a page in facebook?

The scenario is I want to post some details on a facebook page created by me from my other app. So want to know how can we give access to app through access token means how can we get the access token for this?
Thank You
Regards
Yes, take a look at the following URL and the "Page Access Tokens" section for information on how to do obtain a token.
API - Obtain Page Token
Note, however, that there is a known issue when trying to use the links api point, if you intend to define your own link in the post.
Bug report
You'll probably want to use the feed API point instead. I've not actually managed to get this working yet though, and I'm awaiting feedback from FB themselves. I'll update you if/when I hear something useful back.
Good luck.
You can get the access_token for you page by enabling the manage_pages permission, and then calling the API endpoint: /me/accounts to get the access_token for all the pages you manage.
You can then use this access token to post to your page using the Graph API call: /{page_id}/feed

Resources