t
@User
@Vapi Is there a batch-calling feature in the API? So I don't have to make numerous API requests for numerous phone numbers to call?
v
@Trent™ Currently, our VAPI does not offer a direct batch-calling feature. However, you can programmatically iterate through a list of phone numbers and make individual API requests for each one to place outbound calls. If you need to make calls with different messages, you can specify a temporary assistant for each call or reuse an assistant by its ID for similar messages. If you're looking to optimize this process or have any specific requirements, please let me know, and I'll do my best to assist you further!
You can continue this conversation by mentioning me in the message.
@Trent™ Yes, VAPI does support batch calling, allowing you to make multiple outbound calls with a single API request. You can specify a list of phone numbers and a message or an assistant to handle the calls. If you need to use a temporary assistant for each call with a different message, you can specify that in the
assistant
field. For repeated messages or interactions, you can use an existing assistant by specifying its
assistantId
. Would you like to proceed with a batch call, and if so, could you provide the details such as the list of phone numbers, the message or assistant details, and any other specific requirements you have?
t
Can you make me an example batch call using the API in NodeJS? I would like to call numerous phone numbers at the same time, is there a way to incorporate different data from the prompt for each individual call?
@Vapi Can you make me an example batch call using the API in NodeJS? I would like to call numerous phone numbers at the same time, is there a way to incorporate different data from the prompt for each individual call?
k
@User
c
of course you can make batch calls.... whatever your concurry limit. limit is how many calls you make at a time. Also did you try to make a batch call or no?
t
I'm not sure how to do that to be honest, I didn't see it anywhere in the API docs. If I have 100 calls in the batch, will it just queue the other 90 up?
@Vapi I imported a twillio phone number and when I run my api request, I get this error: 'Phone Number ` Does Not Exist.'
v
@Trent™ It seems like there might be an issue with the phone number identification in your API request. The error message indicates that the phone number you are trying to use is not recognized by the system. This could be due to an incorrect or malformed phone number, or the number might not be properly set up in your Twilio account. To resolve this, please double-check that the phone number you are using is correctly imported into your Twilio account and that you are using the correct format in your API request. If you continue to experience issues, please provide me with more details about the steps you've taken, and I'll be happy to assist you further. If necessary, I can guide you through the process of verifying your phone number with Twilio.
t
I purchased a phone number through the dashboard, but when I try and use its UUID in my API request, it says the number does not exist. How long does it take to start working?
@User
c
1. You are doing something wrong. 2. I am not sure how to explain. You have an automation that makes the call. Are you not familair with creation automations?
t
Here's my JS code:
Copy code
var data = {
    'assistant': {
      "firstMessage": "Welcome to our pizza shop! How can I help you today?",
      "model": {
        "provider": "openai",
        "model": "gpt-3.5-turbo",
        "messages": [
          {
            "role": "system",
            "content": prompt
          }
        ]
      },
      "voice": {
        "provider": "11labs",
        "voiceId": "IKne3meq5aSn9XLyUdCD"
    },
    },
    phoneNumberId: phoneID,
    'customer': {
      'number': '+1234',
    },
  }

  const options = {
    method: 'POST',
    headers: {Authorization: 'apikey', 'Content-Type': 'application/json'},
    body: JSON.stringify(data)
  };

  var responseData;
  await fetch('https://api.vapi.ai/call', options)
    .then(response => response.json())
    .then(data2 => {
      responseData = data2;
    })
    .catch(err => console.error(err));

    console.log(responseData);
I mean I asked the Chatbot on the website about the api request, and basically just took what it had, the error code I get is:
Copy code
{message: 'Phone Number `8670ffe8-` Does Not Exist.', error: 'Bad Request', statusCode: 400}
obviously I cut out the full ID, but I literally just copied it from VAPI dashboard... when I make the call from the dashboard, it works just fine.
@Chowderr thoughts?
c
You would not do this JS. Close but this is not the answer. It would your CRM or a workflow in Make.
You are using GS?
d
why shouldnt you be able to do this in JS? I'm attempting the same thing and making an array of calls doesnt work either.
c
From like a sheet? or I did not say it was not possible. It's just usually you would not use JS to trigger a bunch of calls. Especially if in a sheet. The sheet can be "watched" instead.
d
no like this, similar to how its done in bland :
Copy code
{
  "name": "test_httpie",
  "assistant": {
    "model": "gpt-4o"
  },
  "customer": [
    {
      "numberE164CheckEnabled": false,
      "number": "..."
    },
    {
      "numberE164CheckEnabled": false,
      "number": "..."
    }
  ],
  "phoneNumber": {
    "twilioPhoneNumber": "+...",
    "twilioAccountSid": "...",
    "twilioAuthToken": "..."
  }
}
c
but like from where? You hae ont answered that question.
d
calling it from node js server/api route/httpie it doesnt work wherever
t
Yes, that's the same problem I'm having as well.
The API is literally for calling the requests from NodeJS or any other server
d
exactly! its driving me crazy
t
i've tried it a couple different ways.... it obviously works in the dashboard with the same phone.
d
There doesn't seem to be a real way to batch like bland
t
If you look on the dashboard, go into API calls or whatever it's called, then you can actually see the JSON data.
The JSON data I posted, is basically the same.... so it giving the phonenumber not found error is insane
I don't mind not being able to create a batch... I just want to make a single call.
d
I got the same error alos no matter the number used
t
You can always iterate through a list to create something similair to a 'batch'
Are you able to call a single phone number via the API?
d
You cant make a call at all?
t
Nope..
d
I can make A call just not several at a time... Thats weird
t
Waht's your code look like?
d
for making a single call I just did this
Copy code
{
  "name": "test_httpie",
  "assistant": {
    "model": "gpt-4o"
  },
  "customer": {
    "numberE164CheckEnabled": false,
    "number": "...."
  },
  "phoneNumber": {
    "twilioPhoneNumber": "+...",
    "twilioAccountSid": "...",
    "twilioAuthToken": "..."
  }
}
t
the code I pasted above is what I saw on their Docs
interesting... you're using the phone number info, I thought once it's added to the dashboard u can use the UUID?
well actually I can't use the PhoneNumber Twillio info since I bought the number thru the dashboard.....
d
I think you should try with a phoneNumberId maybe in replace of what I did since you bought a number.
t
right yeah, I am doing that, still says not found for whatever reason
d
Yea beats me... Think I'm gonna go back to bland lol. pricey but things just work there.
t
right, that's kind of what I was thinking lol... for making lots of calls there just too many caps though
d
Thats the only reason I tried vapi... just gonna have to suffer with the limits : (
t
seems so unfortunately.... at least until their support gets on and potentially fixes their api?
k
Bland has some strict limits tho and those caps only get taken off if you pay a heavy fee, that's one of the reasons why I wanted to see how Vapi worked as well
d
Yup yup, only option right now for my use case is to create a queue system to handle the limits from bland until I can scale to the higher limits.
k
Well quite honestly I haven't been fond of Bland support so I hope Vapi is different with their support, we will wait and see I guess.
j
Guys there is no bulk call feature. You need to build this logic yourself. For instance you can have a list of phone numbers in a Google sheet, create an automation that pulls 10 phone numbers and sends them to the API individually. You could then setup a 2 minute wait before the next batch of 10 numbers
t
@Jotham any idea why my phone number says it does not exist?
c
I keep trying to tell you that you are wrong. There are a plethoera of people doing batch calls lol. The API is great. You are doing it wrong.
I have said this like 10 times
Why would you be putting in Twillio information if you bought it from Vapi ?
t
I'm not .... I'm using the phoneID in the API call
The only error I get is saying the phone number doesn't exist.... I bought it thru the dashboard and am using the UUID on the phone number page
There's no reason for it to be saying it's not found... I don't understand
k
@Chowderr @Jotham ^^
c
@Shubham Bajaj is there a bug currently?
t
Are you just making the calls from the dashboard? Or through a 3rd party software
Even when I'm using the https://docs.vapi.ai/api-reference/calls/create-call form from the documentation I get the same error:
Copy code
{
  "message": "Phone Number '...` Does Not Exist.",
  "error": "Bad Request",
  "statusCode": 400
}
s
@Trent™ / @Chowderr can you share some context?
c
wanted to know if there was a bug with phone numbers. I had this happen to me earlier as well. Will come back after I check it agai.
t
Mine just started working.... We're good for now lol
22 Views