Integrate Vonage Phone Number via API with Vapi
# support
p
How to integrate a Vonage Phone Number via API. You mention in GUI, that Vonage has a lot less latency. 🙂 Unfortunately the website on setting it up is empty: https://docs.vapi.ai/api-reference/phone-numbers/import-vonage-number Please share some API docu with me, so that I can do it! Thank's Philipp
v
message has been deleted
@Philipp Hello Philipp! I'm glad to hear you're interested in integrating a Vonage phone number with our API. You're right, Vonage can offer lower latency for some use cases. Here's how you can import a Vonage phone number using our API: You'll need to make a POST request to the following endpoint:
Copy code
https://api.vapi.ai/phone-number/import/vonage
Here's an example of how you can do this using cURL:
Copy code
bash
curl --request POST \
  --url https://api.vapi.ai/phone-number/import/vonage \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "vonagePhoneNumber": "YOUR_VONAGE_PHONE_NUMBER",
    "credentialId": "YOUR_VONAGE_CREDENTIAL_ID",
    "name": "A_NAME_FOR_YOUR_NUMBER"
  }'
Make sure to replace
YOUR_ACCESS_TOKEN
with your actual VAPI access token,
YOUR_VONAGE_PHONE_NUMBER
with the phone number you're importing,
YOUR_VONAGE_CREDENTIAL_ID
with your Vonage credential ID, and
A_NAME_FOR_YOUR_NUMBER
with a friendly name for your number. If you need the code in a different programming language, please let me know and I can provide that as well. If you have any further questions or need assistance with the API, feel free to ask!
You can continue this conversation by mentioning me in the message.
p
@Vapi but how do I make / create a call via Vonage using Vapi API
v
@Philipp To make a call via Vonage using the VAPI API, you would typically use a separate endpoint specifically designed for initiating outbound calls. While I don't have the exact endpoint or detailed documentation since the page you referred to is empty, the process generally involves sending a POST request to an API endpoint with the necessary details for the call. Here's a generic example of how you might make a call using cURL, which you would need to adapt to the specific requirements of the VAPI API:
Copy code
bash
curl --request POST \
  --url https://api.vapi.ai/calls \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "to": "NUMBER_YOU_WANT_TO_CALL",
    "from": "YOUR_VONAGE_NUMBER",
    "answer_url": "URL_TO_YOUR_ANSWER_WEBHOOK"
  }'
In this example: - Replace
YOUR_ACCESS_TOKEN
with your VAPI access token. - Replace
NUMBER_YOU_WANT_TO_CALL
with the phone number you want to call. - Replace
YOUR_VONAGE_NUMBER
with your Vonage phone number that you've imported to VAPI. - Replace
URL_TO_YOUR_ANSWER_WEBHOOK
with the URL to the webhook that provides the call flow or Nexmo Call Control Objects (NCCO). Please note that this is a hypothetical example, and the actual API call might have different parameters or require additional information. Since the documentation is not available, I would recommend reaching out to VAPI support for the exact details on making a call via Vonage using their API. If you need further assistance or have more questions, feel free to ask!
s
Import the number directly via dashboard and use the phonenumber id
p
thanks! 🙂