Outbound calling with Blocks
# support
f
How can I initiate an outbound call via the UI or via API using blocks?
Please assist. I'm unable to make outbound calls using our blocks workflow.
Help @Vapi
v
@frank I'm here to assist you with making outbound calls using blocks in your workflow. Could you please provide me with more details about the issue you're facing? Are you encountering any specific error messages, or is there a particular step in the workflow where you're getting stuck? The more information you can provide, the better I can assist you.
f
I don't know how to initiate an outbound call using blocks @Vapi
v
@frank Initiating an outbound call using blocks typically involves using a visual programming interface where you can drag and drop different components to create your call workflow. Here's a general step-by-step guide on how you might do it: 1. **Access the Workflow Editor**: Open your voice API platform's workflow editor where you can create and manage blocks. 2. **Start Block**: Look for a start or trigger block that begins the outbound call process. This is usually the entry point of your workflow. 3. **Make Call Block**: Find a block that is designed to make an outbound call. This might be labeled something like "Make Call," "Outbound Call," or "Dial." 4. **Configure Call Block**: Drag the "Make Call" block onto the canvas and configure it. You'll typically need to specify: - The target phone number you want to call. - Caller ID (if applicable). - Any other call settings that your platform allows, such as call timeout or call recording. 5. **Additional Logic**: If your workflow requires more logic, such as playing a message or handling user input, add and configure the appropriate blocks (e.g., "Play Audio," "Gather Input"). 6. **Connect the Blocks**: Ensure that the blocks are connected in the correct order to reflect the flow of the call. 7. **Save and Test**: Once you've set up your blocks, save the workflow and test the outbound call to ensure it works as expected. 8. **Deploy**: If the test is successful, deploy the workflow so it can be used in a live environment. If you're using a specific platform, the names of the blocks and the exact steps may vary. If you can provide the name of the platform or tool you're using, I can give you more detailed instructions. If you're still unsure or need further assistance, please let me know!
f
There is no make call block @Vapi or anything of the sort
v
@frank I apologize for the confusion. If there isn't a specific "Make Call" block or similar in your workflow editor, it's possible that outbound calls are handled differently within your system. Given that you're using VAPI (Voice API), you might need to initiate an outbound call programmatically through the API rather than through a block-based interface. Typically, this would involve sending an HTTP request to the API endpoint designated for making calls, with the necessary parameters such as the destination number, caller ID, and any other required call settings. Here's a general outline of the steps you would take to initiate an outbound call via API: 1. **Prepare the API Request**: Construct an HTTP POST request to the Voice API's outbound call endpoint. This request will include the necessary headers, authentication, and a JSON payload with details about the call. 2. **JSON Payload**: The JSON payload should specify the destination number, the caller ID, and any other relevant parameters that the API requires. 3. **Send the Request**: Use a tool like
curl
or a programming language with HTTP client capabilities to send the request to the API. 4. **Handle the Response**: The API will respond with a status message or a call object. You'll need to handle this response appropriately in your application. If you're unsure about the specific API endpoint or the required parameters, you should refer to the documentation provided by your Voice API platform. If you need further assistance with constructing the API request or if you have any other questions, please let me know!
f
Which API call do I use within VAPI, and which field in the payload is required? @Vapi
v
@frank To initiate an outbound call using VAPI (Voice API), you would typically use the "Create Call" API endpoint. The specific endpoint and the required fields in the payload can vary depending on the API's design, but I can provide you with a general example. Here's a basic outline of how you might construct the API call: 1. **Endpoint**: The endpoint for creating a call is usually something like
POST /calls
or
/v1/calls
. 2. **Required Fields**: The payload for the API request often requires at least the following fields: - `to`: The phone number you want to call, formatted in E.164 format (e.g., "+1234567890"). - `from`: The phone number or identifier for the caller ID that will be displayed to the recipient. - `answer_url`: The URL that VAPI will request when the call is answered to retrieve the call control instructions (e.g., a URL pointing to an NCCO). Here's an example of how you might use
curl
to make the API call:
Copy code
bash
curl --request POST \
  --url https://api.vapi.ai/v1/calls \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "to": [{"type": "phone", "number": "DESTINATION_PHONE_NUMBER"}],
    "from": {"type": "phone", "number": "YOUR_VAPI_NUMBER"},
    "answer_url": ["https://your-server.com/answer"]
  }'
Replace
YOUR_API_KEY
with your actual API key,
DESTINATION_PHONE_NUMBER
with the number you want to call,
YOUR_VAPI_NUMBER
with your VAPI number or caller ID, and
https://your-server.com/answer
with the URL that provides the call control instructions. Please note that this is a general example, and you should consult the VAPI documentation for the exact endpoint, required headers, and payload structure. If you need further assistance or if you have any specific questions about the fields or the process, please let me know!
f
But where can I add the block ID to the API request?
But where can I add the block ID to the API request? @Vapi @User
v
@frank In the context of VAPI (Voice API), if you're referring to a "block ID" as part of the API request, it sounds like you might be talking about a specific identifier for a pre-defined action or set of actions that you want to execute during the call. This could be part of an NCCO (Nexmo Call Control Object) or a similar call control instruction set used by your Voice API platform. Typically, the block ID wouldn't be directly included in the API request to create a call. Instead, you would reference the block ID within the call control instructions (like an NCCO) that are hosted at the
answer_url
you provide in your API request. When the call is answered, VAPI will fetch the NCCO from the
answer_url
, and the NCCO will contain the instructions, including any block IDs or action IDs, that dictate the call flow. Here's an example of how an NCCO might reference a block ID:
Copy code
json
[
  {
    "action": "talk",
    "text": "This is a text to speech call from VAPI."
  },
  {
    "action": "conversation",
    "name": "BLOCK_ID_GOES_HERE"
  }
]
In this example, the "conversation" action might reference a pre-defined conversation block by its ID. When VAPI fetches this NCCO, it will execute the actions in order, including joining the call to the specified conversation block. If your platform uses a different method or if you have a specific parameter for a block ID that needs to be included in the API request, please refer to the platform's documentation or provide more details so I can give you a more accurate answer. If you're still unsure about how to include the block ID in your API request or if you need further clarification, please let me know!
f
This is extremely frustrating @Vapi. How can I send calls
s
Hey @frank apology for the delayed response, as of now you cannot initate the outbound calls using blocks, let me check with team when it will be available to use with outbound calls.