curl — the REST API is standard.1npm install @ruut/voice-sdk
1234567import { RuutVoice } from "@ruut/voice-sdk"; const client = new RuutVoice({ accountSid: process.env.RUUT_ACCOUNT_SID, authToken: process.env.RUUT_AUTH_TOKEN, baseUrl: "https://voice.ruut.chat", });
1234567891011121314import { VoiceResponse } from "@ruut/voice-sdk"; const twiml = new VoiceResponse() .say("Hello from Ruut Voice!") .toXml(); const call = await client.calls.create({ to: "+2348000000001", from: "+2348000000002", twiml, statusCallback: "https://app.example.com/calls/status", }); console.log(call.sid, call.status); // CA… queued
curl:12345curl -X POST "https://voice.ruut.chat/2010-04-01/Accounts/$RUUT_ACCOUNT_SID/Calls" \ -u "$RUUT_ACCOUNT_SID:$RUUT_AUTH_TOKEN" \ --data-urlencode "To=+2348000000001" \ --data-urlencode "From=+2348000000002" \ --data-urlencode "Twiml=<Response><Say>Hello from Ruut Voice!</Say></Response>"
123<Response> <Say voice="alice">Thanks for calling Ruut Voice!</Say> </Response>
12345import { VoiceResponse } from "@ruut/voice-sdk"; const response = new VoiceResponse() .say("Thanks for calling Ruut Voice!", { voice: "alice" }) .toXml();
statusCallback URL to receive call state changes. The current call-status delivery job does not add an X-Twilio-Signature header or retry failed requests. Restrict access to the callback endpoint and confirm important state through the authenticated Calls API. See call status webhooks.