Bad request from redirect url setting up a new authentication connection setting for Instagram on Azure Bot Service - node.js

I am trying to set up a new connection setting for Instagram on Azure as described on this tutorial (https://channel9.msdn.com/Shows/AI-Show/Conversational-AI-and-Authentication) at time 2:30 to OAuth with a Card in Skype
The issue seems to be with the redirect url when coming back to https://token.botframework.com/.auth/web/redirect
I am currently trying to use OAuthCard in my Skype Bot using
https://github.com/Microsoft/BotBuilder/blob/master/Node/examples/basics-oauth/app.js
I am using this OAuthCard in Skype - I click it and it redirects, asks for approval to my account/sign in - I give it and it then redirects and give a blank white screen with "Bad request"
I am expecting it to return to the Skype chat and continue the dialog
It redirects to:https://token.botframework.com/.auth/web/redirect?code=xyz&state=abc
N.B. If I go to my Instagram account I can see that I have given my app access, so it is not an issue there.

Related

Instagram Referral Code not sent via Webhook (messaging_referral event)

We've setup our app to receive webhook calls from Instagram when a user visits our conversation on Instagram Direct using ig.me link. We insert referral codes in ig.me links so we know where the user comes from (e.g. https://ig.me/m/testpagename?ref=website).
The problem we're facing is that IG is not calling the webhook for messaging_referral event, although we're subscribed to that event.
When we test the subscription on the dashboard, we do get the data, but in production, nothing comes in. Our app is live and the rest of it is working perfectly.
**Important note: the referral webhook is working perfectly for FB Messenger. It's only IG direct that is not working.
**
We raised this to Meta developer support, but no response!
Any thought please?

Whats App chatbot with twilio function to login into 3rd party web application

Need guidance to develop whatsApp chatbot to login into a 3rd party application using twilio functions.
Whenever a user sends whatsApp message to twilio number I want to login into 3rd party web application and query necessary data and respond back to the user with query response. Since the web application doesn't have any REST API implementation I cannot use axios or any 2FA authentication to log in. Authentication should be done by through browser. Currently, I don't have a clue to how to login dynamically.
Tried to do with puppetter.js, cypress.js, nightwatch.js, but no luck.
This is an web application where LCO's can login and activate/de-active/payment for their customer STB boxes. They don't have any 2FA, service based architecture. All can be done by login into their web application only.
Through puppeteer/nightwatch/cypress i tried opening browser window dynamically to login into the system. I have a standalone cypress spec to open the browser and login dynamically. All these steps i want to do with help of twilio functions.
Below is the flowchart.
Customer Send whatsapp message to twilio number
- STB ACTIVATE 6983784934
- Twilio function to open url in background
- Login with credentials
- Search STB
- Activate STB by clicking activate button in screen
- Take screenshot of the updated status
- Send screenshot with success message to End user

Instagram webhook not activating

My goal is to use the Facebook webhooks to get a notification whenever an IG user mentions my IG account. For that I have followed these steps:
I have created a Facebook page and connected it with an Instagram business account.
I have created a Facebook app (which is now live) and added the product "webhooks".
I have connected my app with my page.
I have created a webhook and subscribed to the mentions event.
I have tested the webhook, using the tools provided by Facebook and it works.
The problem I'm facing is that I can't get my app to work with real data. I have tried to mention my business IG account from my IG personal account, but nothing happens. My callback url is not getting called.
My app doesn't need users to login, so I'm not sure if I need to send my app for review. Do I need a special permission?
I had the same problem. For my case, when I installed the app via graph api explorer, the page token I was using didn't have the instagram_manage_insights permission. So I granted that permission, got a new token, re did the POST request to the {page-id}/subscribed_apps again with the new token and that fixed the problem. Just for the record, I used a system user token from the business manager.
Did you verified your Facebook app via app review? If not, you won't get production data via a webhook callback for the Instagram. I had the same issue and asked the Facebook support and got following response:
However, this is not the same for instagram or pages. This is just how the product teams have decided to implement it. For app review, you can show a mock process of the flow, using either the test webhook or your own process. The app review is less about technical implementation steps, but just a way to make sure that your app is going to use the permission in a way that follows our guidelines, so mocking the procedure should be fine. The reviewers understand that you do not receive webhooks in dev mode and should take this into consideration.
For more information check out following links:
Why is the Instagram Graph API webhook not working
https://developers.facebook.com/support/bugs/495933900986533/
I just figure it out of this problem.
There is a mistake in the official Instagram webhook guide:
With Graph API version 3.2, the /{page-id}/subscribed_apps edge now requires the subscribed_fields parameter, which currently does not support Instagram webhooks fields. To get around this, use your app's dashboard to subscribe.
https://developers.facebook.com/docs/instagram-api/guides/webhooks/#install-app
However, the app's dashboard subscribe is another function. You need your page to subscribe to some field to receive webhooks
Just POST /{your-instagram-connected-page-id}/subscribed_apps?subscribed_fields=feed&access_token={your-instagram-connected-page-token}
Then you will receive webhooks in live mode.

Can I create auto reply bot in Slack just using "Bot Users" without slack app?

I want my bot to reply to particular keywords. As per the https://api.slack.com/bot-users, we can create custom bot without slack app. But how do I get OATH tokens without an app but just Customer Bot User?
That works. After installing a Custom Bot you automatically get the corresponding OAUTH token for that bot. Just go to "Manage Apps" / "Custom Integrations" / "Bots". Then click on your settings for your bot to get your token.

Messaging Webhook for Microsoft skype bot

I'm setting up a Microsoft Skype bot, and I want to be able to have it post messages to individual and group chats. I have added a bot at https://developer.microsoft.com/en-us/skype/bots/manage and checked the Messaging checkboxes, but there's a field for "Messaging Webhook", which says "The HTTPS URL to send chat messages and content to. Required if you have a chat capability". What do I put in this field? There's no obvious help link. Do I need to set up an Azure website?
Solution for Node.js:
If you want to test your bot locally, you need to follow the instructions for ngrok described in the comments of this example and this guide. Once you run ngrok, you will obtain a HTTPS URL such as https://62a8271e.ngrok.io. You then need to append /api/calls to this URL, i.e. the webhook URL you need to enter in the Skype channel configurations and as environment variable "CALLBACK_URL" would be https://62a8271e.ngrok.io/api/calls.
If you want to test your bot globally and you have deployed it as an Azure web app, you need to replace the ngrok URL with your bot URL, i.e. the URL should look something like https://yourbot.azurewebsites.net/api/calls. Don't forget to add this URL as an environment variable in your web app settings as well.

Resources