how do i get the customers phone number in the mak...
# support
u
I need to send the customers phone number through to pull up an account, any way to send this through on make without asking the customer
v
Hi @! ArduinoGuru, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Inbound Calling]() * [Outbound Calling]() * [Outbound Sales Example]() * [Create Phone Call]() -----------------------------
### Answer To get the customer's phone number in your Make automation to book an appointment without directly asking the customer, you can extract this information from the call details when you create a phone call using Vapi. When you initiate an outbound call with Vapi, the customer's phone number can be included in the call setup details. Here’s how you can do it in a Python script, based on the Vapi documentation:
Copy code
python
import requests

# Your Vapi API Authorization token
auth_token = 'YOUR_AUTH_TOKEN'
# The Phone Number ID, and the Customer details for the call
phone_number_id = 'PHONE_NUMBER_ID_FROM_DASHBOARD'
customer_number = "+14151231234"  # Customer's phone number

# Create the header with Authorization token
headers = {
    'Authorization': f'Bearer {auth_token}',
    'Content-Type': 'application/json',
}

# Create the data payload for the API request, including the customer's phone number
data = {
    'assistant': {
        "firstMessage": "Hey, what's up?",
        "model": {
            "provider": "openai",
            "model": "gpt-3.5-turbo",
            "messages": [
                {
                    "role": "system",
                    "content": "You are an assistant."
                }
            ]
        },
        "voice": "jennifer-playht"
    },
    'phoneNumberId': phone_number_id,
    'customer': {
        'number': customer_number,  # Here is where you include the customer's number
    },
}

# Make the POST request to Vapi to create the phone call
response = requests.post(
    'https://api.vapi.ai/call/phone', headers=headers, json=data)

# Check if the request was successful and print the response
if response.status_code == 201:
    print('Call created successfully')
    print(response.json())
else:
    print('Failed to create call')
    print(response.text)
[(1)]() This script sets up an outbound call using Vapi. The customer's phone number is specified in the
customer
object within the
data
payload. This way, you can automatically include the customer's phone number in your Make automation process for booking an appointment, without needing to ask the customer directly. Remember to replace
'YOUR_AUTH_TOKEN'
,
'PHONE_NUMBER_ID_FROM_DASHBOARD'
, and
"+14151231234"
with your actual Vapi authorization token, the phone number ID from your Vapi dashboard, and the customer's phone number, respectively. This approach allows you to programmatically manage call setups with all necessary details, which can then be integrated into your Make automation workflows.
u
okay that solves it for outbound how does it work for inbound calls
m
Hey @! ArduinoGuru were you able to resolve it?