Connect App Flutter with API instagrame Publish comment - flutter

I have a question about connecting my app, made with Flutter, with the Instagram API.
I want the user to register with their account, store the access token and then send a post to the API to publish a comment or add a like.
Can I do this with Flutter or do I need to use a different language like Python?

I checked the API documentation that Instagram provides and it seems that you can only do read-only requests (liking a post might not be possible).
The API you mentioned in your tags will not work with personal accounts, as Instagram states:
The API cannot access Instagram consumer accounts (i.e., non-Business or non-Creator Instagram accounts). If you are building an app for consumer users, use the Instagram Basic Display API instead.
You can try to use the mentioned Basic Display API instead, but mind you won't be able to author any posts or do actions in behalf of the user. To circumvent this, you might have to reverse-engineer the frontend facing portion of Instagram but I won't go into that.
To come back to your question, Flutter is well able to send network requests as mentioned here, but you still have a long way until you have functioning access to Instagram (check the Getting Started).

Related

Is there a way to use POST/GET Requests for messages, on your Personal Profile on Facebook Messenger

I've looked through the API and it's all for Facebook Pages to set up a Chatbot.
I wanna be able to set up a Webhook/Listener for chats/messages on my personal profile (to mess around a little).
I'm asking cos I can see unofficial Messenger apps on the Play Store, and they don't look like just a web implementation.
No, there is no way to do that using the official APIs.
Read access to user conversations has been removed a long while ago already, and there is no webhook functionality for this either.

How to get user data now with restrictions on instagram platform api?

There have been lots of changes to the facebook api recently, which now includes the instagram api as well. https://www.instagram.com/developer/changelog/
They have shutdown a lot of endpoints way ahead of schedule and has created a huge problem for my application which integrates instagram user data. They have the instagram graph api now, but looks like it can be used only for business accounts (looked like that prima facie). Reading through the news past couple of days, I am really confused about what is available and what is not. My application used to get user data (number of followers, recent posts, reach, likes, etc) using the instagram handle provided by users. Since this is totally restricted on the platform api now, is there a way I can have the same functionality using the new graph api? Or should I look into 3rd party APIs? I am open to asking users for authentication (I already have the facility). Can the user information be fetched after they authenticate my app to do so?
You can use the following Graph API to get all the details for any IG business account.
https://developers.facebook.com/docs/instagram-api/business-discovery

Social media notification integration to our website

Following are my requirements
created space in website that user can come and sign up with FB or Instagram to integrate their account
Through Graph API for FB and API for Instagram, I can able to view and post the images to FB (post is not possible to instagram)
My requirement would be any activities (like and share ) happened at the FB or Instagram page should receives as notification to my website
I came to know there is no direct APIs available to achieving notifications but I have seen them in "Social Stream" app.
any help would be appreciated on how could achieve this functionality
TIA
You can get likes, comments and posts using API. You can poll them at regular interval, compare new data and create your own notifications.
(You have to get your app approved by Instagram to get API permissions, which may be possible for your usecase, if you do get approval, then its possible to achieve what you are trying to do.)

How to test FB messenger bot with multiple users

Has anybody yet a way to interact with an FB messenger bot without using real FB accounts? I want to do automated testing and obviously not use real accounts for that.
I was not able to figure out how to allow access to a page to 'test users' or create a test page and subscribe the test app to it.
Any ideas on how to do this?
I use a wee web app I made to act as a local version of the facebook messenger api server and run user actions.
https://github.com/Fraser-Greenlee/bot_tester
On it you can write a script to define new users and their actions.
From the Facebook developers dashboard, select your app and then Roles. From Roles you can add other Facebook users as test users. It was easiest for me to use the users facebook id. Adding by email did not always work for me.
I am not aware of how to access a Facebook bot without a Facebook account. I created several fake accounts and had my friends test the bot. After testing, I deleted the fake accounts.
For more information on setting up a bot see my article Facebook Bots for Fun and Profit
The example bot is DMS Software Bot
The source code is Github fb-robot
Testing fb bot with non-fb user is currently not supported. Following are the reasons:
fb messenger requires the user to be logged
fb creates page scope ids (PSID) for each user who is interacting with the bot and hence login on fb is required
Coming to your question on testing:
you can add fb users as tester to your page and your app. Explained here. For your app https://developers.facebook.com/apps/[app-id]/roles/
Once added they will be able to send message to your bot (page) from messenger
On another note, if you are using 3rd party apps to build your bot (eg: api.ai, wit.ai) they already have emulators within the app which makes testing easier.
One easy way to achieve automated testing for messenger bots atleast is to try to mimic a request coming from FB. You can just log the request you are getting to your bot to find the signature of the request that FB sends. Then you can just pretend to be FB by sending http requests with the same signature. You will also have to add in code to respond to these http requests with your reply instead of just sending the message to FB's send API.
So in node it would be something like
sendMessage(<your reply>);
res.send(<your reply>);
Now you have an automated way of sending and receiving messages which you can use for automated testing.
However I think the bigger challenge is coming up with enough test cases. You need to use a combination of clustering over available data and classification to generate new cases.
I have been working on a tool to make this easy. So if you are interested you can sign up for early access. http://ozz.ai

How to simulate silent login to Facebook Graph API?

I'm working on an API that will aggregate data from several website, including facebook. The API has an engine that harvests data on regular intervals, and then the client app polls the API to get the data from all websites centrally.
The problem is that the API has no way of authenticating on the regular, behind-the-scenes harvests, as Facebook insists that the user has to click on the OAuth Dialog. With the short story being that there is no way to login to graph API silently this almost means that developing such an API is not possible (except for harvesting only public data).
However, I'm not easily satisfied by "it's not possible" answers and my clients - even less so. Accessing private information on demmand is defnitely possible as Facebook apps do that. For example, the official Twitter app posts on my wall whenever I tweet. I guess apps only need a permission once and then can access the user's profile as much as they like.
So this leads me to think that I should do a combination of a Graph API client and an application that talk to each other, and whenever the API needs to harvest - it asks the app to get the data and fetch it to the API. Or maybe it should be a push model (the app sends the data whenever it's generated) rather than pull (the API requests the data at regular intervals).
Am I on the right track? Is any of these the correct design approach?
I did some searching but it's very hard to find any useful discussion on the topic as whatever keywords I try I only find "Can I login silently? No" type of discussions.
You'll want to look into the offline_access permission. This lets you access a user's data when they don't have an active session, or are offline. That's as close to "silent login" as you can get.