static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid   = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken    = "your_auth_token";
        const string workspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var stats = WorkerRealTimeStatisticsResource.Fetch(workspaceSid);

        var activityStatistics = stats.ActivityStatistics;

        for (int i = 0; i < activityStatistics.size(); i++)
        {
            var activity = activityStatistics[i];
            Console.WriteLine(activity["workers"] + " in " + activity["friendly_name"]);
        }
    }
Esempio n. 2
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        // To set up environmental variables, see http://twil.io/secure
        const string accountSid   = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        const string authToken    = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");
        const string workspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var stats = WorkerRealTimeStatisticsResource.Fetch(workspaceSid);

        var activityStatistics = stats.ActivityStatistics;

        for (int i = 0; i < activityStatistics.size(); i++)
        {
            var activity = activityStatistics[i];
            Console.WriteLine(activity["workers"] + " in " + activity["friendly_name"]);
        }
    }