Twilio Notification Triggers - Subaccount Usage - twilio

I'd like to get an email notification from Twilio anytime a subaccount has used over 1,000 message units in a month. Is there a way to create a Twilio notification trigger that would do this? Currently, I have to go into the subaccount usage report in the console, run through about 15 pages of info looking for users that have run up a bill over $15 and check their individual usage to see if I need to up their pay tier.

From the Twilio console, click the Billing (upper right corner) -> Usage -> Triggers. I can take some amount of time before the usage trigger fires, but it will fire.
Create a Usage Trigger
There is also an API so you can programmatically create the triggers in each sub-account.
REST API: UsageTrigger

Related

Twilio voice calling with schedule calls

We are building a voice calling application ie (https://github.com/twilio/voice-quickstart-ios#11-make-client-to-client-call), calling working good with great sound quality. We have a new requirement to schedule a call outside of the application, ie instead of the call occurring through the application, it will occur by a normal dial-in number.
Our use case as follows
Caller clicks on agents profile.
The caller sees a list of available dates/times that agents are available. Let's say April 10th at 1 pm PST is available.
Caller selects April 10th at 1 pm and presses "Schedule".
The caller is prompted to pay $100 for a 1-hour call at the selected time.
The caller enters credit card information and presses "Pay".
The caller sees a confirmation message:
Your call is now booked with John Smith! Please call (555-555-5555 -
Twilio number) at 1 pm on April 10th, 2020.
We want to know the following
If a user calls to a Twilio number, can we redirect that call to our agents(ie we have several registered agents in our application)
When users calling, we want to know who is calling and where to redirect this call.
I think we can manage scheduling with our application logic. Let us know, what all services Twilio provides for executing such a scenario, we would love to know is there is any other way around. Your help is much appreciated.
Thank you.
You can look at products such as Twilio Studio. Studio allows you to easily set-up a call forwarding scenario, but the hyperlinked article has many way to accomplish this task. It sounds like you have already built out the agent assignment functionality.

Twilio SMS Webhooks and Group Text Messages

Is it possible to maintain both group text messages and single text messages with users and keep them separate? I understand there is no concept of a group message per se, but wanted to see if any recent advances in tech has made this possible with Twilio or other providers.
In short, I am creating a POC where a user inside an iOS App can send invoke an API call to my backend application. This application receives a phone number from someone's contact list, and then connects to Twilio to send the SMS message to that target user.
When the user replies, I was researching Twilio Web hooks to receive the message, and then save it in the database. The originating user, then, would be able to see the message on a screen.
I would guess that when a user responds to the twilio message, the only metadata that comes in is their message and phone number, so the "foreign key" is the phone number.. Thus when I save it in my database, I have their phone number and message.
This works up until someone decides to target two or more people in an SMS message using my API, and then target one of those people individually. For example they select me as a sole recipient, and then select me and someone else as a group text message.
In this case, how could my system/Twilio differentiate between if I was responding to the group message, or to the single message?
Any ideas or work arounds? Maybe another technology? Thanks!
I wanted to provide an answer to this in case anyone else was looking into this.
Essentially you pay 3 cents (0.03) per month per active user in each group. Basically you buy phone numbers for each group chat you need.
https://www.twilio.com/conversations/pricing
So if you're doing a million group chats obviously it can get costly, but for simple POCs this isn't the end of the world.
Enjoy!

botbuilder-timeout for Typescript Virtual assistant

We have Microsoft Virtual Assistant built it Typescript and we are planning to add Timeout capability. What this means is VA should end the conversation with its Skill if user is not engaged for certain amount of time.
There is botbuilder-timeout module to do this in V3 SDK which says,
"Module for Microsoft Bot Framework to enable your bot to prompt the user if the bot detects inactivity and ultimately end the conversation if no user activity after a defined period of time."
Is there anything in V4 or Virtual Assistant that offers similar capability ? If yes any ideas/pointers to document is appreciated.
There isn't anything official for V4 bots like this. I don't believe I've seen anything unofficial, either.
That being said, we generally recommend something like:
On each message, start a synchronous timer. You can do this in the bot, but it would be better to do outside of the bot, like with Azure Functions or something. The rest of this answer will assume the timer is outside of the bot. Ensure the timer also keeps track of the conversationReference related to the timer.
Restart the timer each time the user matching that conversationReference sends a message
Once the timer expires, send an event to the bot with the user and conversation information (maybe through ChannelData), letting the bot know the timer has expired. You could also create a separate endpoint and monitor there, so you don't need the activity scheme; instead of /api/messages, you could use something like /api/expiredTimers.
Once the expired timer event is received, send a proactive message to the user to either 1) see if they're still there, or 2) end the conversation.

Audit logs retrieval in slack

I need to check audit logs for activities done between a timeperiod on my slack account. I couldn't find any API/methods which can help me with audit logs retrieval. I need to see what all users have been added, removed or invited between a given timeframe. Any help on how this can be done?
There are of course methods to download login (team.accessLogs) and integration activity (team.integrationLogs), but they only provide a part of the functionality you asked for and the first is only available on paid tier.
However you could develop a small custom app for logging all required activity using the new Event API. With the Event API your app can subscribe to any event type you like to log. Whenever an event of that type occures Slack will send a request to your app, with detailed context information. Your app can then store this info in a file for later retrieval and analysis.
e.g. users added: https://api.slack.com/events/team_join

How to disable automated SMS responses in Twilio?

In March I opened a website that provides people with temporary numbers to be used to receive SMS verifications etc.
I've just logged in to the account and realised that I've received a ton of charges for outbound SMS.
They appear to be a default automated response whenever any of my numbers receives a SMS.
I didn't enable this (seems as though it's some sort of money making thing on their side). How do I disable it?
Go to your project, open https://www.twilio.com/console/phone-numbers/incoming and select the number. In Messaging in A MESSAGE COMES IN select TwiML and click Plus button. Give it some name and paste
<?xml version='1.0' ?>
<Response></Response>
there. Save
Twilio evangelist here.
When you buy a Twilio phone number it comes configured with a default Message Request URL that uses the TwiML <Sms> verb to send a reply back to any incoming text message.
<Response>
<Sms>Thanks for the message. Configure your number's SMS URL to change this message.Reply HELP for help.Reply STOP to unsubscribe.Msg&Data rates may apply.</Sms>
</Response>
If you want to prevent those replies you can change this default behavior by providing your own Message Request URL or by using our integrated TwiMLBin feature and returning an empty TwiML response to Twilio:
<Response />
Here is an article from our FAQ that has more info:
https://www.twilio.com/help/faq/sms/how-can-i-receive-sms-messages-without-responding
Hope that helps.
(2021 Update)
Few things were updated in Twilio / mainly their Admin Dashboard GUI but I'll try to simplify it for anyone reading this still. Trust me when I say I completely understand the frustration of the lack of simplicity when it comes to how they operate. The phrase "Work Smarter, Not Harder" doesn't exist in that company (lol):
Log into your Admin Dashboard Account: https://www.twilio.com/login
Go to your Active Phone Numbers: https://console.twilio.com/?frameUrl=/console/phone-numbers/
If that URL changes, add Active Phone Numbers to your Develop dashboard first VIA
🔴 Develop Tab -> Explore Products -> CTRL + F "Phone
Numbers" -> Click the Pin Button
Then access your Active Phone Numbers VIA
🔴 Develop Tab -> Phone Numbers -> Manage -> Active Numbers -> Click Active (###) ###-####
🔴 Scroll down to Messaging -> Select Webhooks, TwiML Bins, Functions, Studio, or Proxy is selected for Configure With Other Handlers -> Select Function for When a Message Comes In -> Select Default for Service -> then leave the Function Path empty.

Resources