How to retrieve caller Phone number without asking...
# support
m
Is there a VAPI variable for getting user's phone number? =
v
message has been deleted
@Mad In VAPI, to retrieve a user's phone number, you would typically use a function designed to list or get phone numbers associated with your account or a specific user. However, to provide you with the exact variable or function, I would need to know the context in which you're trying to obtain the user's phone number. If you're looking to list all phone numbers associated with your account, you can use the List Phone Numbers API endpoint. If you need to get a specific user's phone number, you might need to use a different API call or function that is designed to retrieve user-specific information. If you can provide more details on what you're trying to achieve, I can assist you better.
You can continue this conversation by mentioning me in the message.
m
@Vapi I've created a SMS-sending integration with VAPI that sends out SMS to the user's phone number while on the call. The problem I'm facing right now is that the Agent is asking for the phone number. I am wondering if there's a variable that I can just put into the prompt so the Agent does not have to ask for the phone number, but instead just use the caller phone number from the variable
v
@Mad In VAPI, when you're handling a call, the caller's phone number is usually automatically available as part of the call context. This means you can access the caller's phone number without needing to explicitly ask for it. Typically, there would be a predefined variable that holds the caller's phone number, which you can use in your SMS-sending integration. This variable is often named something like
caller_id
,
from_number
, or
caller_number
. You would insert this variable directly into your SMS prompt to automatically use the caller's phone number. Please check the documentation of the specific VAPI you are using or the context of the call handling to find the exact name of the variable that contains the caller's phone number. Once you have that, you can modify your SMS-sending integration to use this variable instead of prompting the agent to ask for it.
m
@Vapi Can you give me the link to that documentation
v
@Mad I apologize for the confusion earlier. It seems there was a glitch in our conversation. To find the documentation that includes information about accessing the caller's phone number for your SMS-sending integration, you can visit the VAPI documentation page. Here is the link you requested: [API Reference - Vapi Documentation](https://docs.vapi.ai/enterprise/soc#API-Reference) Please navigate to the API Reference section, where you should find the details on handling calls and accessing call context variables, including the caller's phone number. If you can't find the information you're looking for, please ask support for more info on this.
m
@Vapi I cannot find a variable that has user's phone number
v
@Mad Please ask support for more info on this.
m
@User Could you guys help please?
s
You have to assign server url to your phone number and remove assistantID/squadId from your phone number and then vapi will send a request of type server event to your server url in the payload you get call object inside that you will get the customer phone number. for more check docs.
20 Views