Is there a way to determine which phone number cal...
# support
s
I have one assistant, and one tools call to get all properties for a property manager. I want ot determine which property managment company the user is calling based on the number they called. So if I have 5 numbers using one assistant -> tools call for properties to one supabase database -> determine the properties to talk about based on the number that was called by the user -> give correct properties. I'm not sure how to pass phone_number_id through the webhok so my supabase call can be filtered by it.
v
@Stephen To achieve the functionality you're describing, you'll need to pass the
phoneNumberId
as a variable to your assistant, which can then be used in the webhook to filter the Supabase call. Here's how you can do it: 1. Ensure that your assistant is configured to accept a variable for the
phoneNumberId
. 2. When you send the request to the
/call/phone
endpoint, include the
phoneNumberId
in the
variableValues
within the
assistantOverrides
. Here's an example of how your JSON payload should look:
Copy code
json
{
  "assistantId": "your-assistant-id",
  "assistantOverrides": {
    "variableValues": {
      "phoneNumberId": "the-specific-phone-number-id"
    }
  }
}
Replace
"the-specific-phone-number-id"
with the actual ID of the phone number that was called. This ID will then be accessible in your assistant, and you can use it in your webhook to filter the Supabase database query for the correct property management company. If you need to send this request now, please provide me with the specific
phoneNumberId
you want to use, and I'll help you dispatch the request. If you're unsure about the
phoneNumberId
or any other parameters, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
s
But what if the user calls a phone number using a phone, how can this request be modified in real time?
s
@Stephen You can use call object to get phoneNumberId which is part of tool call payload as
call.phoneNumberId
. Do let me know if you require further help!! https://cdn.discordapp.com/attachments/1325860793438306375/1326487020260032564/Screenshot_2025-01-08_at_15.15.00.png?ex=677f9ace&is=677e494e&hm=b3bdcccb03749058f577b9e75477e47e76ffb895754918247fd39a25a26191a2&
s
Yesss I found that, thankyou for your help
2 Views