Skip to main content
Creates multiple outbound phone calls in a single request using your configured assistant.
For full setup and authentication options, see the Installation guide: /api-reference/introduction.

Parameters

connectionConfig
ConnectionConfig
required
Configuration for the client connection.
request
CreateBulkPhoneCallRequest
required

Usage

import {   
  AssistantDefinition,
  CreatePhoneCall,
  ConnectionConfig,
  CreateBulkPhoneCallRequest,
  CreatePhoneCallRequest, 
} from '@rapidaai/react';

const connectionConfig: ConnectionConfig = { /* ... */ };
const phoneCallRequest = new CreatePhoneCallRequest();
// define assistant
const assistant = new AssistantDefinition();
assistant.setAssistantid("ASSISTANT_ID_PLACEHOLDER");
assistant.setVersion("VERSION_PLACEHOLDER");
phoneCallRequest.setAssistant(assistant);
phoneCallRequest.setTonumber("TO_NUMBER_PLACEHOLDER");

const bulkPhoneCallRequest = new CreateBulkPhoneCallRequest();
bulkPhoneCallRequest.addPhonecalls(phoneCallRequest);
CreateBulkPhoneCallRequest(connectionConfig, phoneCallRequest)
  .then((x) => {
    if (x.getSuccess()) {
      console.dir(x.getData().toObject());
      return;
    }
    let err = x.getError();
    if (err?.getHumanmessage()) setError(err?.getHumanmessage());
  })
  .catch((x) => {
    console.dir(x);
  });

Response

code
int
Numeric status code for the operation
success
boolean
Indicates whether the operation was successful
error
Error
data
AssistantConversation[]