twilio-node icon indicating copy to clipboard operation
twilio-node copied to clipboard

Taskrouter statistics method expecting SID parameter

Open serdar opened this issue 3 years ago • 4 comments

Issue Summary

The documentation to retrieve the statistics for a specific worker (https://www.twilio.com/docs/taskrouter/api/worker/statistics#fetch-a-specific-workers-statistics) states no additional parameters for the .statistics() method, however, the current version of the Node library requires an SID parameter.

Can the documentation please be updated to refer to the current published version of the Node library, or please specify what the SID should be to gather the statistics.

Code Snippet from Documentation

// Download the helper library from https://www.twilio.com/docs/node/install
// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken);

client.taskrouter.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
      .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
      .statistics()
      .fetch()
      .then(worker_statistics => console.log(worker_statistics.cumulative));

Code Snippet from workerStatistics.d.ts

interface WorkerStatisticsListInstance {
  /**
   * @param sid - sid of instance
   */
  (sid: string): WorkerStatisticsContext;
  /**
   * Constructs a worker_statistics
   */
  get(): WorkerStatisticsContext;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

Technical details:

  • twilio-node version: 3.67.1
  • node version: v16.10.0

serdar avatar Oct 07 '21 04:10 serdar

Ah. This appears to be a bug in our autogenerated code. Thanks for pointing this out, @serdar. This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

eshanholtz avatar Oct 14 '21 22:10 eshanholtz

Same problem for client.messaging.deactivations()

Alex-Bond avatar Jun 23 '22 07:06 Alex-Bond

Bumping internally (DI-2172).

childish-sambino avatar Jun 23 '22 14:06 childish-sambino

Update: This is now work-in-progress and will be ready for the next release candidate.

Hunga1 avatar Sep 20 '22 20:09 Hunga1