You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m migrating from 2.x and finding that the documentation is wrong. For example, look at the sample code here: https://www.twilio.com/docs/api/rest/account (of course, choose Node.js as the language and 3.x as the SDK version). The code looks like this:
// Download the Node helper library from twilio.com/docs/node/install// These consts are your accountSid and authToken from https://www.twilio.com/consoleconstaccountSid='< my account id >';constauthToken='< my auth token >';constclient=require('twilio')(accountSid,authToken);client.accounts('< my account id >').fetch().then((account)=>console.log(account.dateCreated));
But when I run this I get:
node app.js 444ms Fri May 19 09:21:33 2017
/Users/nate/Desktop/tmp/app.js:8
client.accounts('< account id redacted >')
^
TypeError: client.accounts is not a function
at Object.<anonymous> (/Users/nate/Desktop/tmp/app.js:8:8)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
at bootstrap_node.js:542:3
So I’m not sure how to use the accounts property. The docs seem to be wrong?
We use TypeScript so it would really help if we had TypeScript defs (issue #250). That would go a long way towards resolving issues like this as I would be able to see which methods and properties are actually available and work from there.
The text was updated successfully, but these errors were encountered:
(twilio-node version 3.0.0 and Node v7.10.0)
I’m migrating from 2.x and finding that the documentation is wrong. For example, look at the sample code here: https://www.twilio.com/docs/api/rest/account (of course, choose Node.js as the language and 3.x as the SDK version). The code looks like this:
But when I run this I get:
So I’m not sure how to use the
accounts
property. The docs seem to be wrong?We use TypeScript so it would really help if we had TypeScript defs (issue #250). That would go a long way towards resolving issues like this as I would be able to see which methods and properties are actually available and work from there.
The text was updated successfully, but these errors were encountered: