Table of Contents

Class ConnectorServiceClient

Namespace
Livekit.Server.Sdk.Dotnet
Assembly
LivekitApi.dll

A client for interacting with the Connector service, which connects WhatsApp and Twilio calls to LiveKit rooms. Only available in LiveKit Cloud.

public class ConnectorServiceClient : BaseService
Inheritance
ConnectorServiceClient
Inherited Members

Constructors

ConnectorServiceClient(string, string, string, HttpClient)

Creates the client.

public ConnectorServiceClient(string host, string apiKey = null, string apiSecret = null, HttpClient client = null)

Parameters

host string

URL of the LiveKit server, http(s):// or ws(s)://; a subpath such as https://host/livekit is kept.

apiKey string

API key; the LIVEKIT_API_KEY environment variable when omitted.

apiSecret string

API secret; the LIVEKIT_API_SECRET environment variable when omitted.

client HttpClient

Optional HttpClient to send the requests with. The SDK never modifies it, so it can be shared with other clients and code.

Methods

AcceptWhatsAppCall(AcceptWhatsAppCallRequest)

Accepts an inbound WhatsApp call.

public Task<AcceptWhatsAppCallResponse> AcceptWhatsAppCall(AcceptWhatsAppCallRequest request)

Parameters

request AcceptWhatsAppCallRequest

WhatsApp phone number ID, API key and the ID of the incoming call to accept.

Returns

Task<AcceptWhatsAppCallResponse>

The accepted call.

ConnectTwilioCall(ConnectTwilioCallRequest)

Connects a Twilio call to a LiveKit room.

public Task<ConnectTwilioCallResponse> ConnectTwilioCall(ConnectTwilioCallRequest request)

Parameters

request ConnectTwilioCallRequest

Twilio call direction and the room to connect the call to.

Returns

Task<ConnectTwilioCallResponse>

The URL Twilio must connect the call to.

ConnectWhatsAppCall(ConnectWhatsAppCallRequest)

Connects an established WhatsApp call, for business-initiated calls.

public Task<ConnectWhatsAppCallResponse> ConnectWhatsAppCall(ConnectWhatsAppCallRequest request)

Parameters

request ConnectWhatsAppCallRequest

WhatsApp call ID and the SDP of the call; optionally wait until it is answered.

Returns

Task<ConnectWhatsAppCallResponse>

The connection details of the call.

DialWhatsAppCall(DialWhatsAppCallRequest)

Starts an outbound WhatsApp call.

public Task<DialWhatsAppCallResponse> DialWhatsAppCall(DialWhatsAppCallRequest request)

Parameters

request DialWhatsAppCallRequest

WhatsApp phone number ID, API key, the number to call and the room to connect the call to.

Returns

Task<DialWhatsAppCallResponse>

The WhatsApp call ID and the room.

DisconnectWhatsAppCall(DisconnectWhatsAppCallRequest)

Disconnects an active WhatsApp call.

public Task<DisconnectWhatsAppCallResponse> DisconnectWhatsAppCall(DisconnectWhatsAppCallRequest request)

Parameters

request DisconnectWhatsAppCallRequest

WhatsApp call ID and the reason.

Returns

Task<DisconnectWhatsAppCallResponse>

Empty response.