Instagram Messenger API Registering Webhooks - instagram-graph-api

I'm building an integration that manages Instagram Messenger chats on behalf of clients. In the past I've done an integration for Facebook Messenger.
I'm stuck on how to actually get the client Instagram subscribed to our Instagram Messaging webhook events.
The 'Setup webhooks' section on the Instagram Messaging docs just points to the general webhook setup for the messenger platform, which explains to use the /PAGE-ID/subscribed_apps endpoint specifying the fields (events) to subscribe to. I do this with the previous Facebook Messenger integration, but with Instagram I'm running into several problems.
First I tried to subscribe to the following fields messages, message_reactions, messaging_seen
An error response explains it's not possible to subscribe to messaging_seen.
Then I try with only messages, message_reactions and get the error pages_messaging permission is required which is not mentioned in the Instagram Messaging docs.
I'm only aware of these issues because I'm failing the App Review because the webhooks are not working for the reviewers. In testing my own Facebook Page / Instagram Business account it is working fine presumably because I own the Page/IG account I'm trying to connect. Because of that I've been able to record a complete video of the functionality, but the reviewer feedback keeps implying that they also need recreate that functionality themselves to pass it.
This thread suggests to use mocking, but I think that's for the creating the video rather than for the reviewers to use. I'm also not sure how you would mock something like the delete function without the webhooks anyway.
I haven't been able to find much information about this, so any pointers would be greatly appreciated

Related

while using whatsapp with twilio, can I still use Facebook Whatsapp api directly?

facebook recently allow everyone to send marketing messages, and create marketing templates.
but when try to create whatsapp template in Twilio dashboard there is no such option as marketing message(just transaction)
I wonder if its ok for me to create templates directly through Facebook or it will mess thing up and I must use Twilio directly?
there is more missing options like attaching media or header to template
twilio dashboard (no marketing category):
facebook dashboard:
tldr: is it ok to use Facebook api directly when using Twilio to register my Whatsapp number?
I checked on this question with Twilio product support and the answer was:
I don't believe this would be possible, as the number and configuration would be tied directly to Twilio. You could certainly try, but this is not something we can offer guidance on or provide support for if you proceed.
I don't have my own WhatsApp number to try with, so I can't verify or test whether you can use the Facebook APIs directly either.
If you are in the Content API beta and you are finding that it still doesn't provide you the features you need, then I recommend raising that with the beta team, who will work to bring it to the API.

Posting to a teams channel from a logic app or flow which includes an banner alert / activity feed item

I have a logic app which posts a channel chat message to teams automatically when a new item is created in SharePoint. This I have working but our client requires that all the team members receive a banner alert and activity feed which I am having a lot of difficulty with.
What I've already tried...
Using a Incoming web hook on the teams channel - this was a very simple way to post from the logic app but the incoming webhook don't seem to support mentions.
Using the msft graph api - The /team/channel/message endpoint can post messages and user mentions but the this endpoint doesnt support channel or team mentions. It also appears that the graph API needs to use delegated permissions to post messages in teams. I'm using application permissions as this is a logic app. The logic app HTTP post connector doesnt offer the "connect as username#tenant.com" some of the other connectors use.
Using the flowbot post message - Like the above channel and team mentions are supported here so the post is added to the channel but with no notification to the team members
Using a notification only bot - I thought I nearly had it with this one. Microsoft's node bot sample number 57 looked like it can do most of what I want, it iterates through the users in the team and messages them this a customisable alert message...
https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/57.teams-conversation-bot
However I can't see how this bot can be triggered from my logic app as it seems to require an existing conversation context or an #mention from within teams to start communicating with users.
What I'm considering trying next
Iterating users within the logic app - Next I plan to try and get team membership from the graph API and iterate the members in the Logic App, posting a message to each user separately. I had hoped to utilise the group #mention feature as a simpler way so I'd be grateful if anyone had any thoughts on other ways of doing this, or maybe there's something wrong with what I've already tried that you could give me some expertise on.
Thanks in advance ;)
Andy
You're on the right track with the Bot, but you're wanting to send something called a "Pro-active" message. You need the bot registered in the channel in order to get access to a few key properties (conversation id, service url, etc.), but you can use those to send a message from -outside- your bot (e.g. in an Azure Function). You might be able to do this directly from a Logic App, but I haven't tested that specifically.
To find out more, see my answer at Programmatically sending a message to a bot in Microsoft Teams but I've also got a recent blog post that you might find interesting for background on this at How Bots Actually Work.
Hope that helps
You can use Graph to post a message in 1:1 chat as long as you have the chat it. You can find the answer in this post Send message to personal Chat via Graph API
You can also call Graph API from Logic Apps. (https://techcommunity.microsoft.com/t5/integrations-on-azure-blog/calling-graph-api-from-azure-logic-apps-using-delegated/ba-p/1997666#:~:text=Calling%20Graph%20API%20from%20Azure%20Logic%20Apps%20using,Manage%20-%3E%20Certificates%20%26%20secrets%20More%20items...%20)

How to make your bot user reply with a simple help message using slack bot

I have created a slack bot and I want to send a general static help message to users when they send a direct message to my bot:
Should I subscribe to Events API? Or do I need to do this in another way? I couldn't find a clear answer for this.
There are two ways to do make your bot user reply to direct messages:
Events API
Real Time Messaging API
In my opinion the Events API approach is easier to implement since it does not require using WebSockets.
The basic approach with the Events API is:
You need an endpoint that can receive event requests from Slack and
react to it, e.g. by sending a direct message back to a user.
Subscribe to message.im event for your bot user
Note that a bot user already has all the required scopes for this with the bot scope.
In addition I would recommend to subscribe to app.mention for your bot user. Then it can also react to mentions in other channels.
Btw. that message you posted looks a lot like a review comment from the Slack team for a new app submission. I got a similar one for my last app and I solved it with the approach above. In general it looks like if you want to have a bot user in your app it needs to be able to respond to help request from users.

How To Post Link To Friends Wall Using The Facebook IOS SDK?

I am looking for some advice on the best approach to achieve posting to a users wall from either the IOS App or my server.
Background
My app is currently available and incorporates the Facebook SDK. At the minute there is a custom social network in the app where users can join via Facebook Connect and share their edited photos. The user in the app uploads their photos to my server and then the app will fetch them for other users to see i.e. (latest, categories) etc.
I am looking at creating a web based viewing platform, think instagram where the users can also see their photos.
Goal
At the point of upload from the app I want to be able to post to the users friends on Facebook with a link to the web based image. I am unsure whether or not to send the notification from the app or post it from the server.
Can someone point out what it is that I need to do to achieve the above? I would imagine that I need to ask for extended permissions and then post an open graph notice. Is this correct?

How do I submit my Facebook graph api action for approval?

I have a mobile phone app, supporting web site and a Facebook account
When certain actions are taken on my phone app I interact with my web server. My web server then posts some info to a page on MY Facebook account.
I chose to use the graph api to achieve the posts to my Facebook page but I can see no way of complying with Facebooks requirements for submission.
When I try to submit facebook states the following
No Aggregations created for this Action Type. Please create a
completed Aggregation populated with sample data before submitting for
review.
Firstly I have no idea what an aggregation is?
Then the docs state
Review your Action Type before submitting for approval. Make sure your
definition is complete and your app is testable end-to-end for
publishing actions of this Action Type
Which makes sense but how do I get my mobile app to Facebook staff so they can test?
I should add that all works fine in development mode
If you are trying to create an action via the Facebook Open Graph Beta, you should first look into the documentation here. There you will find all information on actions, objects and aggregations you can generate on the timeline.
Further you will have to go to the subsection Open Graph of your App Settings:
https://developers.facebook.com/apps/YOUR_APP_ID/opengraph and create your aggregations populated with sample data.
If you want to make a simple post though, then use the Graph API and POST a Post object to the feed connection of the User object. There are a lot of examples and tutorials on the web and a lot of questions on that matter here on stackoverflow.

Resources