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: Installation guide and Authentication.

Parameters

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

Usage

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

const connectionCfg = ConnectionConfig.DefaultConnectionConfig(
  ConnectionConfig.WithSDK({ ApiKey: process.env.RAPIDA_API_KEY })
);
const phoneCallRequest = new CreatePhoneCallRequest();
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);
CreateBulkPhoneCall(connectionCfg, bulkPhoneCallRequest)
  .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[]