Provision for creation of functions in Twilio autopilot from our backend - twilio

I want to configure the Twilio autopilot functions to persist the user inputs and use them across the chatbot application. Is there any provision for creating functions from our backend application or are there any other provisions for getting the values in the memory so that I can use them thoroughly across my client-side chatbot application?

Have you taken a look at Twilio Sync? You could persist some information in there, json format, and retrieve it from any other Twilio validated app or function. You can subscribe to the different item events as well, to show up-to-date information if you'd need it to change.
https://www.twilio.com/sync

Related

Determining billing based on which API Key was used?

My organization is using the Twilio SDK in C# to sms and mms messages with a single long code. We have several teams in several different departments using it for various purposes and are looking to track how much of the bill belongs to each team. Each team has an API Key that they are using to authenticate their calls to send a message: TwilioClient.Init(apiKey,apiSecret,accountSid);
Is there anyway to see in the sms logs a breakdown of which API Key was used to send messages?
There is not. You can however use sub-accounts which are logical containers of resources, and then the usage API to determine usage by subaccount.

Is it possible to use Copilot sticky sender with a Flow

I would like to use a flow created in Studio with some Copilot features like Scaler and Sticky sender.
I've a flow created already using Studio, as well as few numbers added to a messaging service, Sticky sender and Scaler are enabled on this service.
I would like to use this messaging service with the created flow, so i don't have to worry about balancing the usage of those assigned phone numbers myself.
When I configure a number I can only assign a messaging service (which i prefer) or a work flow, but not both at the same time. Although it would make sense if I can assign the flow to a messaging service.
Looking at Twilio Client for C#, i see that ExecutionResource.CreateAsync takes a from phone number as required parameter, so it doesn't seem like this is a possible options to have a flow linked to a messaging service.
I'm wondering if there is any workarounds, like having a function maybe to pass a phone number from the messaging service to the flow? or any other way?
Malek, you can also set the From to a messaging service using the From.
Executions
from:
"The Twilio phone number to send messages or initiate calls from during the Flow Execution, available as variable {{flow.channel.address}}"
Should have the added sentence: "You can also use a Messaging Service SID."
Twilio developer evangelist here.
What you want to do in this instance is to configure the number with a messaging service, then set the messaging service Inbound request URL to the flow's REST API trigger URL, which should look a bit like:
https://webhooks.twilio.com/v1/Accounts/<account_sid>/Flows/<flow_sid>

twilio REST API: strictly backend?

The JavaScript chat client SDK is missing some functionality that the REST API has, like list users. Should the 1st person chat client be using the REST API as well to supplement gaps in the client SDK or just in general? Or is it strictly for backend management?
Twilio developer evangelist here
The Chat SDK itself doesn't give all of the same access as the REST API because that would put that access directly in the hands of all users of the Chat SDK. Restricting things like listing users of the app to the REST API means that your application has greater control over those functions and can restrict access or use it only in specific circumstances.
As we've discussed in your other question, how you actually manage things in your application, whether it is by calling to the REST API or storing data in your own user database, is up to you and depends on what will work best for your application.

twilio how to get possible users

I retrieved an access token from my server and have connected the JavaScript SDk chat client like so. I have created a channel like so. The next step I'd like to invite a user like this. In that example they invite the user 'elmo'. Where do I get 'elmo' or how do I present the user with a selection of possible 'elmo's? The client sdk has no list users functionality.
Edit:
It looks like the REST API has a list users method. But can't find any examples of it used. Should the 1st person chat client be using the REST API as well to supplement gaps in the client SDK or should it get the identity from backend? Our team has different interpretations of the docs: twilio REST API is strictly for backend vs. twilio REST API can and should be used any where. Moved to twilio REST API: strictly backend?
Twilio developer evangelist here.
In my opinion Twilio's Chat API should not be the central source of truth of the users in your system. I don't know anything more about your application than what you've written here, but I would expect that you have a user model within your own system that you have used to generate or create an identity that is then used by the Chat API as well as how your user logs in to your system. I would then use that user model to connect users and provide their identities so that they can join chats together.

Twilio Hosting - Segregated Hosting

Can Twilio be hosted separately (specific to a customer) on the Twilio cloud?
This is for a customer requirement where they want their call details to be segregated and stored separately. Is this possible in Twilio?
Twilio developer evangelist here.
You won;t be able to host Twilio yourself as it's a cloud platform. What you can do however is have a subaccount for each one of your customers.
This way, their data will be segregated and not displayed with other accounts. This will also allow you or your customers to run reports that are only for that particular account.
All that data is stored in the cloud though, so technically they all live together in the same database.
You can read more about subaccounts here.

Resources