Instagram Basic Display EOL
This is bad news for all users of the extension.
https://developers.facebook.com/blog/post/2024/09/04/update-on-instagram-basic-display-api/
A huge update seems to be required.
Is there already a problem with this upcoming changes? My scheduler task is suddenly failing with the message "Task failed to execute successfully. Class: TYPO3\CMS\Scheduler\Task\ExecuteSchedulableCommandTask" No further information in the t3-log...
Hm... our only customer with this kind of instagram integration refuses to upgrade their Account. I wonder if it's possible to just crawl the data instead of using an API? We'd need only the images and the links after all.
Yes there is: https://apify.com/
I have modified the extension to work with apify, probably will make the repository public next week. Have to wait for tester feedback.
You can find the extension here:
https://github.com/sascha-schieferdecker/TYPO3-instagram
Hope it helps...
Given that a business or creator account on Instagram is free of charge, there should not be a reason to not use the official Instagram API. However, I cannot estimate the difficulty of a migration.
The solution implemented by @sascha-schieferdecker could be used as a fallback instead for personal Instagram accounts. However, this will not be as stable as the official API due to utilized web scraping.
You're correct, my solution should only be considered as a fallback,
I've hacked up a solution for two accounts using the existing extension. Big difference: You have to start with an access token, you cannot get it using the traditional way.
Here's what I did:
- Login to https://developers.facebook.com/
- Create a new App
- Set an app name
- Choose "Other" for use case
- Choose "Business" for app type
- Confirm "Create App"
- Add Instagram product to your app
- Add client Instagram account to the Instagram API (client must have a business professional/creator account for this to work)
- Generate a new token and copy it
I inserted this token into the database directly. And the URLs for getting the posts have to be changed:
https://github.com/in2code-de/instagram/blob/ea9512eadc115a0244fb60f0631b885d9346967a/Classes/Domain/Repository/InstagramRepository.php#L140 has to be changed to:
$url = 'https://graph.instagram.com/me/media/'
Seems it is not possible to access the posts by username if not having advanced API access.
Hope this info helps...
BTW, the scheduler task for refreshing the token works, no problem there. You just need to get the initial access token by the steps as described above.
Hi all, Any news regarding this? Is there interest in upgrading the plugin to work with the Instagram API? Seems to require quite a bit of work. As a temporary solution @sascha-schieferdecker could be used i guess? Thanks!
Only use it if you cannot upgrade a personal account to a creator or business account. There is another API involved, which creates one more step which could fail. From my experience it's stable.
Otherwise you could just do the steps as described above. Refactoring the extension for creator/business accounts should not be that much work. It's mainly refactoring getting the initial token, which has to be replaced by entering a token generated via the meta developer console.
And the documentation has to be updated...
Thank you for your work to develop a solution to deal with the old API's apparent abrupt deprecation and removal by Facebook.
Previously, normal BE users could activate the plugin by following an OAuth flow. @sascha-schieferdecker's temporary solution seems to require that either the administrator have the Instagram account login details to enter in the Meta app console, or that the token be generated by the end user and provided somehow to to the administrator to put into the database. Neither of these options feel right for production use where the BE user and administrator are not at the same company (e.g. agency/client).
The new API's requirement for a creator or business account sounds fine to me.
Thank you for all the tips so far.
I've got the token-creation over the BE working by following the steps of @sascha-schieferdecker and creating the new app on Facebook developer. Additionally, you have to replace the URL in the Classes/Tca/GetToken.php on line 102 with the following:
$url = 'https://instagram.com/oauth/authorize?scope=instagram_business_basic&response_type=code';
(I'm sorry for the poor code comment. I couldn't find a way to do it properly.)
Only use it if you cannot upgrade a personal account to a creator or business account. There is another API involved, which creates one more step which could fail. From my experience it's stable.
Otherwise you could just do the steps as described above. Refactoring the extension for creator/business accounts should not be that much work. It's mainly refactoring getting the initial token, which has to be replaced by entering a token generated via the meta developer console.
And the documentation has to be updated...
Thanks for the clarification. My client has a business account, so your tutorial should work.
I would add something to this. If the schedulers still fail after doing this instructions, check in the database the tx_instagram_token table if expire_date is set to 0. If yes, you must set it to a unix timestamp in the future in order to get the scheduler tasks to run again. Also you must set your user_id to the same as username. This is necessary due to: Line 136 in Tokenrepository:
$token = $queryBuilder
->select('*')
->from(self::TABLE_NAME)
->where(
$queryBuilder->expr()->eq('username', $queryBuilder->createNamedParameter($username)),
$queryBuilder->expr()->neq('token', $queryBuilder->createNamedParameter('')),
$queryBuilder->expr()->gt('expire_date', time()) **<- HERE**
)
->orderBy('crdate', 'desc')
->executeQuery()
->fetchAssociative();
Otherwise the scheduler fails due to no valid token
Keep in mind: Set the new App-ID and Secret from Meta in the content element, so it get saved correctly into the database
For everybody who is looking for an alternative have a look at https://github.com/svenpet90/instagram
it uses Instagram Business Login and seems to work fine
From my research, migrating to the Instagram API with Instagram Login should not be a big deal. The workflow stays the same with the requirement of a new App and an Instagram business account, which is free of charge.
I've started a PR which currently only changes the authentication URL. It directly worked successfully after creating the new app according to the docs. Therefore, only the documentation really needs to be updated.
However, I have read the following note on the website of in2code:
Attention: Due to the renewed, extensive API changes from Meta / Instagram, we have decided to stop the development of this extension!
In my opinion, the API changes are not significant, but the decision must be respected, of course.