Instagram Client ID / new requirements of Instagram API - instagram

I have been using instafeed on a few projects over the past years, all without to many issues.
With Instagrams new API requirements im running into some issues and any help would be just super -
So far I have set up the basic API accsess (generated my ID and accsessToken) -
(so I have completed the docs here - https://developers.facebook.com/docs/instagram-basic-display-api/getting-started)
Im now trying to get my ClientID but cannot seem to find where to do this (given that this chnage is new, allot of the infomation I find online refers to the old way of doing this, which was from:
https://www.instagram.com/developer/clients/register/
However this now returns:
New registrations not supported anymore)
So questions (and again any help here would be really appreciated) -
1) Can you still use instafeed js to show your instagram posts on your site (with all these chnages to the API is it still valid for new accounts)
2) How can I now generate a ClientID?
i.e. (this is from instafeed.js)
var feed = new Instafeed({
get: 'user', // <-- new
userId: 'XXXXXXX <<<< GOT THE CODE', // <-- new
clientId: '??????????????? <<< **need this code for it to work**',
accessToken:'XXXXXXX <<<< Got the code',
template: '<img src="{{image}}" />',
sortBy: 'most-recent',
limit: '6',
resolution: 'thumbnail'
});
feed.run();
Any help on this would be amazing - Sorry if I have asked questions in a junior dev way, I am what I am :P
As a last question (and a little cheeky) -
3) what pit holes have you found with regards to posting Instagram posts on your site with the new API settings (im asking this as "you can only know what you know and what you know you dont know") - so just making sure I havent overlooked something.
Thank you in advance,
Warm regards,
W

Since Instagram doesn't support new developer registrations, you won't be able to get a working clientId for your feed. Instagram's old API is being turned off completely on March 2, 2020, and is in the process of being replaced with the Instagram Graph API - particularly the Basic Display API.
The 'no new developer accounts' policy also extends to 'no new apps', so even if you had an existing dev account, you wouldn't be able to create a new ClientID anyway.
So, to answer your questions:
No, not for new accounts.
You can't as far as I know
I'm not aware of a method to embed a user's IG feed in another website via the new API, using only client-side code (which is how instafeed.js works). More detail on that below.
For instafeed.js specifically, we're investigating whether it's possible/practical to provide a similar result with the new APIs. At this stage, the authentication scheme makes it seem impractical, and there is definitely no mention of 'show my feed on another website' in the examples of allowed use-cases. It may be possible with a server-side application, but not by just dropping a snippet of JS in a page.
Lastly, I'm speculating here, but my strong impression is that this use-case is not desired by FB/IG. The old API had its permissions tightened continuously before it was finally deprecated. It would be trivially easy for FB/IG to provide a simple 'embed my feed' facility with the new API if they wanted to - my assumption is that they want users on instagram.com or in the app to look at that content, not out elsewhere on the web.

I'm not aware of a method to embed a user's Instagram feed in another website via the new API, using only client-side code (which is how instafeed.js works).
That is true... However, if you are willing to think outside the box you can still show your feed on your website. Hint: it requires Zapier to cross-post your Instagram image to a public RSS feed in the background.
Read about it here: https://stackoverflow.com/a/60394300/2397550

Related

Is it possible to access a friends Instagram pictures without his access_token?

I heard that Instagram recently changed their APIs and I have a related question to that.
Let's assume I would like to build an "Instagram feed app of people I follow". So this app would just show me the pictures of all people I follow. From what I understand this would be possible, but I would always have same manual effort:
From the Instagram developer website I understand that I need the access_token from all my friends.
Do I understand that correctly?
This would mean every time I follow someone new, I would have to get his/her access_token manually and add it into my app.
Do I understand this correctly or is there a programmatic/automated way to get the needed access_token from the new followed person?
Yes, you are correct. This is not possible at the moment. I'm not sure how you would get the access token of friends. You would have to have them login as well. BTW: This seems to be the way facebook is going (since they now control Instagram). They require that both friends have authorized your app and then they will list their followers.

How do I fetch my own Instagram media feed

I have a use case that Instagram does not seem to acknowledge. I am hoping that someone else has an idea for what I can do.
The website that I am maintaining has been using the API endpoint:
https://www.instagram.com/anyUser/media/
And I am aware that Instagram has recently stopped supporting this endpoint. So I am looking for a replacement.
My use case is that I do not want to allow the users of my website to authenticate and browse their own photos. Instead I want to show only the latest 20 images that "I" (aka my employer) have posted, one at a time in a loop.
Instagram's API documentation seems to be entirely focused on the use case of allowing users to authenticate and share their photos.
Is there an API call that will return the last 20 images that I have posted?
From its specs, the Sandbox will work fine for me, I cannot find a way to register with Instagram that does not require me to build a user authentication work flow that will NEVER be used.
You would want to use self feed endpoint.
https://www.instagram.com/developer/endpoints/users/#get_users_self
https://api.instagram.com/v1/users/self/?access_token=ACCESS-TOKEN

Must a freelancer keep API Client IDs active for former employers?

I'm a newb with Google OAuth and am trying to understand the different business/application models and which API credential types go with my particular situation.
I am creating a Chrome extension for someone for their own private use which accesses their Google Sheets docs using their personal Sheets account. So, I will not own the code or extension once I deliver it to them and end the contract. So, I do not want to have to maintain any authorization/API ID's or credentials after I deliver the extension and its source code. But, obviously, the extension must continue to work for them indefinitely.
The only way I can see how to accomplish this is to instruct the employer (who has no developer or development skills) on how to create the OAuth Client ID with their own Google API developer console. Then, they can enter the client ID and other codes if necessary into the extension config screen so the extension can use this information for authorizing API calls. This seems like a huge hassle for someone who just wants to buy an extension to do something simple.
Am I missing something? Is there an easier way?
P.S. I know this question doesn't follow the proper format for SO, but this is the only place Google has provided for asking API OAuth 2.0 questions.

Instagram API throwing OAuthAccessTokenException 400 error using client id

I was using the following api to get the latest 3 posts from public accounts to show on the website:
https://api.instagram.com/v1/users/{user-id}/media/recent/?client_id={client-id}&count=3
I had created an app to get the client-id.
However from today, this API has started throwing the following exception:
{
meta: {
error_type: "OAuthAccessTokenException",
code: 400,
error_message: "The access_token provided is invalid."
}
}
Could you please let me know as how to resolve this?
Based on the date, you probably have an older app that got hit by the API migration today, like mine. In short, Instagram decided to make developing for their platform WAY more annoying by requiring all API requests to be authenticated per user, even for data that users shares publicly. So you (like me) will likely be redesigning you app entirely.
To tell, log in to instagram.com/developer and click manage clients; then hit edit next to the set of keys your're trying to use. Up near the top, it will have a section called 'Client Status' -- if yours reads 'Sandbox Mode', fun times ahead! Hopefully you interact with less than 10 users and can stay in sandbox mode, otherwise you'll have to write an essay, film a video, and basically plead to get your permissions back (probably in a few months, when some Instagram intern finally digs his way down to you in the pile of applications). If it reads something eles, you've got another problem altogether and should thank your lucky stars.
In the meantime, I guess I'll get back to sending out dozens of emails to the maintainers of our many, many affiliated Instagram accounts to explain the issue and try to get permissions, so provided we get approved by then, all our social media displays aren't broken during a huge event Saturday. Another option might be to use the OAuth-less json response available here, but that might break terms of service.
I have a solution to this. If you are using the same code I am, which appears likely. I was pulling the last two images using this.
https://api.instagram.com/v1/users/{user-id}/media/recent/?client_id={client-id}&count=3
What I did to get this working is the following.
Login to your Instragram account you are using as the application.
Go to the developer (API) area. https://www.instagram.com/developer/clients/manage/
Manage clients. Make sure your website URL is the same as your valid redirect URL.
Add new Sandbox User. Put in the account of the IG photos you want to reach.
Hit this URL: https://api.instagram.com/oauth/authorize/?client_id=CLIENTID&redirect_uri=REDIRECT_URI&response_type=token where the client ID is the same one you used in your previous app above.
You should get back and access token URL. Copy your access token.
Login as your account that you want the IG photos of. The account you added as a sandbox user and go to developer and approve the Sandbox Invites.
Change your original URL above from https://api.instagram.com/v1/users/{user-id}/media/recent/?client_id={client-id}&count=3 to https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS_TOKEN with your access token.
This is the IG API Media endpoint documentation: https://www.instagram.com/developer/endpoints/users/
After that, it all worked for me and while you are in the sandbox, you should be able to pull the last 3 photos or at this point, figure out how to read the JSON to do so.
Has your app been approved after the June 1st Instagram platform changes?
http://developers.instagram.com/post/145262544121/instagram-platform-update-effective-june-1-2016
If you want to retrieve the user media file then try this, It's working for me
https://graph.instagram.com/me/media?fields=id,caption,media_url,media_type&access_token=ACCESS_TOKEN
For some reason the token is no more valid. Request it again.
Possible reasons why a token is no more valid:
changed password
verified the account
logged-in from a different country

LIKES done by me on my own page don't show up anymore after making an app to post to my page's fanpage

I really hope someone can tell me more about what's going on, because I spent days searching the net and for the life of me can't say what is going on.
Here's what happened. I have a website 4nieuws.nl . On every article's page I put a like button using the Javascript SDK. All worked well. On facebook I created a fanpage for the website, facebook.com/4nieuws and every now and again I would copy an interesting article there. The like button and Javascript SDK on 4nieuws.nl uses the APP Id from an app I created specifically for that purpose.
Then I thought I might automate to publish the most popular articles on the fanpage using the PHP api. I set about getting the proper authorization key using the sequence explained on this page: http://www.typeoneerror.com/articles/post/permanent-facebook-sessions-and-posting-as-a-page
For this to work I authorized the previously mentioned app to publish on the facebook fanpages that I am admin of. And this works.
Now for the strange part. Ever since I authorized the app, if I go to 4nieuws.nl and like a page, or even 'post to facebook', the button shows 1 more like. But the like message never shows up on my personal wall. My wife, logged in to her own facebook account, gets a notification that I liked a page, but when she clicks the notification she is sent to a Facebook 404 page. When I subsequently reload the article, my 'like' is not there anymore.
Has anyone ever come across something like this ? I'm a bit anxious because I am not sure if other peoples likes on 4nieuws.nl are working as it should. I do see likes on pages but have no idea if those likes are actually registering on peoples walls.
Any help greatly appreciated.

Resources