Is there any way to create a custom Conversation ID?

I have a unique ID and phone number and want to start a new conversation with 'uniqueID_phonenumber" as conversation ID. I’m so confused as to how to make this work. Thanks in advance. (rasa 2.X version)

@Hrishikesh1213 - How do you start your rasa ? Are you using the REST API /webhooks/channel/webhook?

From which channel are you trying to connect?

{
  "sender": "test_user",  // This could be your unique ID
  "message": "Hi there!"
}

@souvikg10 The data is first sent to Rasa from rest channel. This data consists of phone number and uniqueID(only used for posting data to rasa). But further I also want to start a conversation with the same “uniqueID_phonenumber” ID through twilio channel and continue the conversation in this twilio channel. How can I make this possible? Thanks in advance

well i have never worked with twilio but if you see the twilio connector code you will notice the sender variable is set from the request coming from twilio as sender = request.form.get("From", None) which i assume is the phone number of the user(since twilio connector is using Programmable SMS) which is thus the unique ID when you use the twilio connector in Rasa

I dont think i have a straight answer but you have few options

  • Isn’t the phone number kind of unique? You could just use that in both cases.
  • You could create a custom channel with the same twilio code as such but append your uniqueID as part of the sender variable before calling on_new_message

@souvikg10 How to access the data which I received at the rest channel and use it in the custom channel?

save the unique ID as unfeaturized slot in your bot’s tracker. then access the tracker in your custom channel

Still what is the purpose of this unique ID since phone numbers are mostly unique?

If it is to manage users, why not try Auth0 like service for authentication as a service where you manage user credentials and look up the user based on their phone number for example, you can receive an access token for the user and use that as a conversation ID. This way you can extend features like authentication, authorization, account linking(though i am not sure if twilio can be linked) etc. If it is to manage user identity and link it to a unique conversation flow, then use auth as a service to manage user lifecycle and drive conversations using access tokens which are unique for a user