instagram api getting access tokens with permissions and scope not working as expected - instagram

I think i am a bit confused, i need Instagram token to upload images and videos. While trying it from https://developers.facebook.com/tools/explorer/
I had to provide permissions publish_video,pages_show_list,instagram_basic,instagram_content_publish,pages_read_engagement,public_profile, attached in the screen shot below
Now what i am doing is trying to get access via code in my app, but i guess the permissions in the above screen shot and the scope in the below urls are not the same. What i want to know is how to get valid token to upload imagess and token. any help would be greatly appreciated
Works:
https://www.instagram.com/oauth/authorize/?
client_id={client_id}&
redirect_uri={url}&
response_type=code&
scope=user_profile,user_media
Does not work:
https://www.instagram.com/oauth/authorize/?
client_id={client_id}&
redirect_uri={url}&
response_type=code&
scope=user_profile,user_media,publish_video,pages_show_list,instagram_basic,
instagram_content_publish,pages_read_engagement

Related

facebook Page Access Tokens to get user profile

First time touching things about facebook.
Trying to do facebook 3rd provider login.
The developer I worked with is doing it through back end instead of how facebook's tutorial is doing it through frontend.
Right now the login works and able to get the return of
accessToken: "EAAaz15rigu"
userID: "10928"
Now trying to get the user profile such as first, last name and avatar.
I searched around and found this documentation
https://developers.facebook.com/docs/messenger-platform/identity/user-profile/#fields
https://graph.facebook.com/<PSID>?fields=first_name,last_name,profile_pic&access_token=<PAGE_ACCESS_TOKEN>
The thing is, there isn't <PSID>Page Scope ID and <PAGE_ACCESS_TOKEN> provided
So again, I searched for page access token
https://developers.facebook.com/docs/facebook-login/access-tokens/#pagetokens
https://graph.facebook.com/{your-user-id}/accounts?access_token={user-access-token}
this is what I see so I entered what is returned from login https://graph.facebook.com/10928/accounts?access_token=EAAaz15rigu
What I see is an empty array though, even if the array is not empty as show in the sample in the documentation. I still don't see anything that is <PSID> that I can use from my backend to get user profile.
Can someone please give me a hand to walk through this?
Thanks in advance for any help / suggestions.

Instagram server side authentication 2019

I just can't get it right.
There are docs for instagram api that says do one call, it will redirect user to a page where he authenticate, then you get code from Redirect Url and now using this code you can get token. That is working and it is just fine. But, what if i want to do a website for myself as personal page and show my own instagram photos filtered by tag to ANYONE. I don't need OAuth, any login. I'm ok with creating Node server and make a call smth like this:
http://api.instagram.com/auth?client_id_or_login=vvinog&password=secretpassword
and get token from this call. But it looks like in the internet no one do this, or i dump?
Can you please advice some tutorial, approach that allows me to do that?
Any code snippets are super welcome.

Issue with commenting on Facebook posts with api

I'm a beginner on Facebook API but after reading up and understanding whatever I could I'm still stuck because I can't find any good documentation that is not outdated.
I'm trying to comment on my own post and I keep getting this error:
Publishing comments through the API is only available for page access tokens
I do understand that I require a page access token for the latest version of the API but even after getting the page access token I'm still facing this issue.
Here is a screenshot of my graph API explorer
Here I first clicked on get user access token and gave it all possible permissions. After that I clicked on get page access token and then tried to post the comment.
Note: The post was made by my ID and is visible only to me, I am sure that the user ID and post ID is correct because I am able to view its details
I also tried it using python with the token ID above and this code.
import facebook
graph = facebook.GraphAPI(access_token=token_id)
#This does give me the post details
#print (graph.get_object(id = my_id +'_10214865328931217'))
graph.put_object(parent_object=my_id+'_10214865328931217',connection_name='comments', message='Test')
But I still get the same error. Seems like there is something about the way page access tokens work that I do not understand.

Browser Said Invalid Request When I Tried to Access a Picture of Instagram

Recently, I wrote an app to synchronize photos in my Instagram to another platform. The GET /v1/users/self/media/recent?access_token=ACCESS_TOKEN result should contains the links to my pictures, like
https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s640x640/e35/sh0.08/11330602_751572388302808_972254350_n.jpg,
and it went very well. But today after clicking the link, it told me Invalid Request. I'm not sure what happened to this cdn link. Any hints would be appreciated.

How do I get an access token from Microsoft Graph API?

I'm currently dealing with the fascinatingly confusing world of Microsoft. I've read several of the half-baked tutorials on how to use their Graph API and Office 365 API and I still don't really know what to do. What I HAVE figure out is how to build that authorization request URL so I can get the "code", which is supposed to be used to then get the access token. I've done this with the Google API and it works beautifully, but not with the Microsoft Graph API. Here's what I have:
https://login.microsoftonline.com/common/oauth2/authorize?client_id=123451234512345&response_type=code&redirect_uri=https://www.my-site.com/oauth-callback/microsoft
When the user clicks on this link, they are taken to the Microsoft login page. So far, so good. But, after entering my login credentials it just takes me right back to the same Microsoft login page, as opposed to redirecting the user to my redirect uri. I have an Azure account with the same redirect URI specified, but it just isn't working. What am I doing wrong? By the way, I'm using node.js. Any links to useful tutorials would be much appreciated.
To get a code you need to pass the following parameters:
response_type=code
client_id=yourClientId
redirect_uri=yourRedirectUri
resource=https://graph.microsoft.com
For example:
https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=12334&redirect_uri=https://myapp.com&resource=https://graph.microsoft.com
Finally, thank you for the feedback, can you please point the articles you read where the information was not clear so we can make sure to update them? I suggest you try the following article: https://graph.microsoft.io/docs/platform/rest
This is a great video explaining the login process: https://www.youtube.com/watch?v=HOcwvuIJHXA "Deep Dive into the Office 365 RESTful APIs". It is very long, but detailed. Around 25:00 it shows with Fiddler how the login works. Helped me a lot.

Resources