Event Streams integration with Azure? - twilio

We are attempting to use a sink from Event Streams to store events in our Azure blob storage. I can see where we can configure a webhook for this purpose, and we are receiving test events to one of our unsecure webhooks. However for prod, we require secure transport, and our Azure instance requires the Ocp-Apim subscription key to be sent in the header. There doesn't appear to be any way to configure this in Event Streams. Has anyone been able to get this or something similar working?

Solved. We were able to set up the event Sink URI with the subscription key using URL encoding. ?subscriptionkey=x.....yyy . This is not in the documentation, but it does work.

Related

How to programmatically send a message to a Teams BOT

I have a BOT running which reponds to api/messages URL from the BOT Framework Emulator, and I can send text to it.
However what I need to do is write an application which sends text to the BOT over this URL. That is basically does what the BOT Framework Emulator does when I enter text and send it, probably over the graph API.
I am aware of information which demonstrates sending to a chat in a channel, but I just need to send to the BOT itself.
Can anyone advise how I can do this, or is there a suitable sample which demonstrates it.
Thanks
At the end of the day, your bot is really just a web api endpoint. If you set up a tunneling service like ngrok, you can use it's built-in web viewer to see the traffic that is sent to you bot, e.g. via the emulator or even via the azure bot registration page (there is a similar emulator built into the page in Azure). Once you've seen that traffic, you can essentially just mirror it from whatever you want to call from - it's essentially a json payload.
However, considering your bot is just a web api, I'm not sure why you want to "call" your bot from another app. Why not just make another endpoint that you can use for app-to-app communication (like a normal api endpoint). You can then refactor your code so that whatever you need to do can be done either via a bot message OR via the API call.

Testing twilio webhooks in dev environment

I have a web app in production using Twilio which makes use of the programmable video API and various webhook call backs. When certain events happen, Twilio lets my API know via the webhook so the appropriate actions are then triggered.
From what I can tell, there is no development (ie: sandbox) environment for Twilio. This is very strange. I would expect there to be a sandbox environment so that we can do complete local development without needing to create fake responses from Twilio for webhooks and the likes.
It appears that Twilio's recommendation is to use ngrok or similar for development. But this is not possible when you already have a production application running and Twilio has no sandbox. I can't simply change my webhook endpoint in my Twilio account to point to my local ngrok end point. That would mean that my production end point is not live during that time.
The other suggestion by Twilio is that we create fake responses which we expect to receive by using curl or similar. This seems incredibly impractical having to trigger fake responses at dozens of different points in time throughout the flow of an app rather than simply receiving them from a sandbox/dev environment with Twilio.
What is the recommended method to do local Twilio related development which incorporates webhook callbacks when you already have a production app running?
I'm not familiar with Twillio specifically but generally speaking, you can add multiple webhook URLs. The idea would be to have one URL pointing to your production server and another pointing to the Ngrok endpoint.
Alternatively, you could use https://hookdeck.io (disclaimer: I'm the founder) to send the same webhook to multiple URLs. We call this webhook fan-out, you could set up both your production URL and Ngrok as destinations and provide a single endpoint (provided by Hookdeck) to Twilio.
It would look something like this:

Need an Api or webhook for youtube streaming notification

I need to find an Api/webhook, source code for youtube. Specifically, that Api/webhook will send me a notification only when a specific youtuber makes a direct live streaming transmission.
Thanks for your help.
You may refer with this link: Is there a way to get notifications from YouTube API when broadcaster is live. It stated that it requires a websocket connection with your API endpoint by using ws:// protocole at some point. Websocket listen to a server, and enable your browser to handle it's changes like events. So it's exacly what u need for notifications.
Also, you may use the GET https://www.googleapis.com/youtube/v3/liveBroadcasts endpoint which returns a list of YouTube broadcasts that match the API request parameters.
However, getting a notification will require some work. It will probably require polling the endpoint for changes to determine if a new broadcast has been started. I'm not aware of a PUSH API from YouTube to send a request to an endpoint of your choice to create a notification.
More info in the YouTube docs.

How to save twilio ip message to a database?

I'm discovering twilio ip messaging and i want to make a simple basic chat application. It's not so difficult but i want every sent messages to be stored in a database.
I was seeking some solutions into the twilio user interface but no such things to help me to solve this issue.
I am using amazon dynamodb. How could i process it so that each time I relogin to the chat i could see messages from the last session ?
Twilio evangelist here.
I think you are looking for the onMessageSend webhook:
https://www.twilio.com/docs/api/ip-messaging/webhooks
You can configure for IP Messaging Service instance with a URL for this webhook either in the account portal or via the rest API. Twilio will request that URL whenever a client sends a message to the channel. The webhook will include the sender id, channel id and message which you can save to your database.
Hope that helps.

How to send message to Slack listening channels?

i am working on a slack app (scope including bot and incoming webhooks). I can send message to a defined channel but i don't know how to stop using the "&channel=" parameter and just send messages to listening channels. By listening i mean, when the app is installed, user is asked where to post (channel or dm has to be chosen).
String postUrl = "https://slack.com/api/chat.postMessage?token=" + botAccessToken + "&as_user=false&channel=%23community&text=testing&username=CommunityQ";
Any hints would be useful.
I think you can't: According to the official Slack API documentation it is not possible to send messages to all/multiple listening channels:
Incoming webhooks output to a default channel and can only send
messages to a single channel at a time. You can override a custom
integration's configured channel by specifying the channel field in
your JSON payload.
I interpret this as "there is always exactly one channel your message is sent to"
Furthermore, Slack restricts this channel override feature for Slack apps:
You cannot override the default username, icon, or channel for
incoming webhooks attached to Slack apps.
I think there is a slight confusion here. I am not sure what the "incoming webhook" scope does that the "bot" scope cannot do. Here's how I see things
Either you want a lightweight, low-permission app that posts in one channel, and you'd use the incoming webhook scope
Or you want an app that can ask questions to the users, like which channels they'd like to have updated posted to, process answers, etc. Then you'd use the bot scope, and the bot can post in any public channel
If you give a bit more details in what you want to achieve we can perhaps help you better
If you want a more dynamic approach on sending messages into any channel I would suggest to user the API method chat.postMessage instead of an incoming webhook.
The API method can post messages into any channel (including private channels, DMs) as long as your token as access to it.
As Michael mentioned in his answer, it is not possible to post to multiple channels at the same time. You have to look through them and do multiple requests.

Resources