How to update contact information in the Router structure May 25, 2023 21:38 Updated When working with Router we need to understand a few things: When thinking about the Router - SubBots structure, it is important to understand that the information associated with the Set Contacts is updated only once even with the activated Context and this occurs in the first client interaction with the Bot - Smart Contact. There are several ways to recover a contact information from a SubBot, this article aims to show you an example of how to update that information: In the example there are two Bots connected to the Router: When accessing, the customer must choose the option in the "ShelBot", and for a humanized service to be performed as expected, the Bot Builder "Test Area" must be accessed: and click on the gear symbol, located in the left corner of the screen: It is necessary to activate the "Router Context": If the customer, when contacting the Bot, chooses option 1, and in a second or any subsequent contact chooses option 2, he will be forwarded to the team he chooses for the first time, in this case option 1. For this not to happen, it is necessary to update the contact in the SubBot via API-HTTP request, and for that we need the access key; and in the lower left corner click on the option "Connection Information": At the bottom of the screen, there is a box called "HTTP Endpoints": Copy the Key located in the "Authentication Header", in the Builder it must be configured in a block before the human service block, to get all the changes made within the flow: The contact will be updated in the “Online Assets” block, select the block and click on “Actions”. In the example we added the "HTTP Request" in the "Incoming Actions", you have to set it up according to the needs of your flow:Note: Use the url with the contract id to consume the endpoints reported below, its performance and operation may be impacted if it does not have the contract id, so it is essential to use the url with the contract id to use http requests! In the method, we will use “POST”, and the URL will be:“https://{{contractid}}.http.msging.net/commands”, In the body, the following information will be updated (in that order): Contact name; Email; Phone number; Cell Phone number; Extra Fields. Inbound Router Option chosen from the menu; Entry time; Linked Attendant; The JSON to be used according to my Bot's variables (you will have to use the custom variables according to those created in your Bot): The "set" method doesn't have a similar functionality to the "Set Contact", the "set" inserts the contact's data ignoring the ones that already existed. For cases where results similar to "Set contact" are desired, the command must be "merge", and with that, the new and old data will be kept. { "id": "{{random.guid}}", "method": "set", "uri": "/contacts", "type": "application/vnd.lime.contact+json", "resource": { "identity": "{{input.message.fromidentity}}", "name": "{{contact.name}}", "email": "{{contact.email}}", "PhoneNumber": "{{contact.phoneNumber}}", "cellPhoneNumber": "{{contact.phoneNumber}}", "extras": { "Número de entrada": "{{city}}", "Option chosen from the menu": "{{intention}}", "Entry time": "{{service}}", "Attendant":"{{contact.extras.Attendant}}", }, "source": "{{contact.source}}" }} What is in quotes is the field to be filled in, and what is in braces is the variable that will fill the content. For more information, visit the discussion on the subject in our community or the videos on our channel. 😃 Related articles How to retrieve contact information in a subbot How to create a bot router with 3 subbots How to Save Contact Information Sending WhatsApp Active Messages on Blip Desk Creating interactive messages in WhatsApp