0

I want to get video call log details from twilio using node.js on the server side. I need details:

  1. what time call started/ended,
  2. duration of a call,
  3. A time duration for which each participant connected in a call.
  4. what time each participant joined/left a call.

All the above details for a completed call.

For the above requirements, I found something: Video Log Analyzer API (beta) on twilio.

But I am not able to understand how can I use this. There is no SDK provided here. If I try to send a request to the URL then

Curl for this is below *

curl "https://insights.twilio.com/v1/Video/Rooms"
-u {account_sid}:{auth_token}

But I don't know how to pass details after -u, i.e. where can I send accound_sid and auth_token in my request. I am trying to use axios to send a request to this URL but where can I pass values of accound_sid,auth_token in the request.

What is -u in curl ?

Can anyone provide me some solution for this or any other idea to achieve my rquirement?

I WAS TRYING SOMETHING LIKE THIS

 const URL = "https://insights.twilio.com/v1/Video/Rooms/"+room_SID+"/Participants/"+partcipant_SID;
      const config = {
        headers: {
          //'content-type': 'application/json',
          //'Authorization': token,
          //WHAT TO DO
        }
      }
      axios.get(URL,config)
        .then((response) => {
          console.log(response);
        })
        .catch((error) => {
            console.log(error);
        });
    

1 Answers1

0

The -u is your Twilio Account SID and Twilio Auth Token, you see the field for it on the main page when you log into your Twilio Console.

enter image description here

There are also some other API's:

Video Log Analyzer API (beta)

REST API: Rooms

REST API: Participants

REST API: PublishedTrack

  • This show active tracks (not when the meeting is completed)

per your comment below, code example:

const axios = require('axios');

const roomSID = 'RM...';
const participantSID = 'PA...';

const ACCOUNT_SID = process.env.ACCOUNT_SID;
const AUTH_TOKEN = process.env.AUTH_TOKEN;

 const URL = "https://insights.twilio.com/v1/Video/Rooms/"+roomSID+"/Participants/"+participantSID;
    axios({
      method: 'get',
      url: URL,
      auth: {
        username: ACCOUNT_SID,
        password: AUTH_TOKEN
      }
    })
      .then((response) => {
        console.log(response);
      })
      .catch((error) => {
          console.log(error);
      });
Alan
  • 10,465
  • 2
  • 8
  • 9
  • Thank you sir for answering my question. I am actually looking for code in node.js to use, as described in "Video Log Analyzer API (beta)" link. I have got account SID and Auth Token, but how to use them in node.js to perform methods described on this link: https://www.twilio.com/docs/video/video-log-analyzer/video-log-analyzer-api – ambarish dashora Feb 05 '21 at 19:02
  • Thank you so much, This is what I was looking for. It worked – ambarish dashora Feb 06 '21 at 18:17