Table of contents
Setting up the Twitter integration for documents
Twitter setup
First you need to apply for a developer account at Twitter. Log-in to the Twitter account you are setting the integration up for. Then head to the Developers dashboard, https://developer.twitter.com/en/portal/dashboard and apply for a Developer account. Once you have been accepted as a developer, go to the "Projects & Apps" section and create a project. Then create an app under that project. Under "User authentication settings" in the app settings, click set up and make sure that the "App permissions" is set to "Read and write". You will need write permissions for the app to be able to publish Tweets. Under "Type of App", select "Web App, Automated App or bot". You will also need to provide a callback URL and your website URL. Even though this is not used by the Twitter integration for now, valid URLs are required.
Then go back to the app settings, go to the "Keys and tokens" tab and generate an API key undir "Consumer Keys". Store the generated key and secret - you'll need those later. Generate authentication tokens as well and store the "Access token" and "Access token secret", you'll also need those as well.
Once this has been done, you should not need to configure anything else in Twitter.
Veva setup
"Twitter": {
"AccessToken": "",
"AccessTokenSecret": "",
"ConsumerKey": "",
"ConsumerSecret": ""
}
Configuring the model
Handler settings
The handler has some configurable options, you can optionally include a URL to the document, so the user can click that link in the Tweet to be taken back to your website. If you include the URL, you can optionally have the URL shortened by checking "Shorten URL", this requires an API key for Bitly. See below. If you want the URL to point to the exact document you were creating, you can include in the URL which will be replaced by the ID of the document.
Finally, you need to specify the body of the Tweet. You can type in any text you want and to include data from the document, use the syntax. If your model has a field called "content", you can use to get data from that field.
Bitly configuration
"Bitly": {
"AccessToken": "your-access-token"
}