0

Get Call

by
Published Jun 6, 2022

Return call resource of an individual call. [See the docs](https://www.twilio.com/docs/voice/api/call-resource#fetch-a-call-resource) for more information

Script twilio Verified

The script

Submitted by hugo697 Bun
Verified 398 days ago
1
import { Twilio } from "twilio";
2

3
type Twilio = {
4
  accountSid: string;
5
  token: string;
6
};
7

8
export async function main(twilio: Twilio, callSid: string) {
9
  const client = new Twilio(twilio.accountSid, twilio.token);
10
  const call = await client.calls(callSid).fetch();
11
  return call;
12
}
13

Other submissions
  • Submitted by hugo697 Deno
    Created 974 days ago
    1
    import { Twilio } from "twilio";
    2
    
    
    3
    type Twilio = {
    4
      accountSid: string;
    5
      token: string;
    6
    };
    7
    
    
    8
    export async function main(twilio: Twilio, callSid: string): Promise<void> {
    9
      const client = new Twilio(twilio.accountSid, twilio.token);
    10
      const call = await client.calls(callSid).fetch();
    11
      console.log(call.to);
    12
    }
    13