Create new instance.
Execute a request against the Twitter API. For successful requests, the [[[HTTPResponse]] object will contain an object or array or objects decoded from the JSON returned by Twitter as appropriate to the request made. Refer to Twitter’s API documentation for details about the expected parameters and responses. Drafts will handle wrapping the request in the appropriate OAuth authentication flow.
an object with the following properties:
Post a status update (tweet) to Twitter. Returns true
if successful, false
if not. After success the lastResponse
object can be used to inspect response and get details such as the ID of the tweet created. Refer to Twitter API POST /status/update documentation for response details.
Creates a new Twitter object. Identifier is a optional string value used to identify a Twitter account. Typically this can be omitted if you only work with one Twitter account in Drafts. Each unique identifier used for Twitter accounts will share credentials - across both action steps and scripts.
Generated using TypeDoc
Twitter
Script integration with Twitter. The
updateStatus
method is a convenience method for posting a tweet, but the entire Twitter API can be used with the request method, which handles OAuth authentication and authorization.Example
// create twitter object var twitter = Twitter.create(); // post tweet var success = twitter.updateStatus("My tweet content!"); if success { console.log(twitter.lastResponse); } else { console.log(twitter.lastError); context.fail(); }