FileMaker tips, techniques, and news.

By Emory Brown  Posted on  November 15th, 2017  in  FileMaker, Free Downloads

FileMaker Twitter Integration

As one of the top social media platforms, Twitter has over 300 million active users worldwide. Leveraging FileMaker technology, developers can build custom apps which interact directly with Twitter. Let's walk through how to get your app connected to Twitter.

Creating a Free Developer Account

First, log into Twitter and create a Twitter App. Second, click the button to generate an API consumer key and an API consumer secret. These two strings are used to securely authorize actions with your twitter account. The consumer key will be passed back and forth with each call, serving as identification. The consumer secret is used to securely encrypt the call in a specific way unique to your account.

Authenticating with Twitter

Once you have your API information, you will need authenticate your solution with the Twitter API. Twitter API uses a OAuth, and there are two types. Basic authentication can be used for actions which do not require user context, such as reading public tweets or getting profile information. User authentication on the other hand, is needed for actions which require an account: tweeting, direct messages, etc. For this example we will use basic authentication to get the number of followers and tweets of any Twitter handle.

The first step is to use a combination of the consumer key and secret key to obtain an access token. These two keys must be combined, separated by a colon, and encoded with Base64. Leveraging the Insert from URL [] script step, FileMaker is able to make HTTP calls and get back the responses. This is the basic mechanic of working with API endpoints.

The token is returned as a JSON string, which FileMaker can easily read with native JSON functions. If you authenticate again, you will be given a new token and all old tokens will become invalid. This process ensures tokens cannot be obtained and used without your permission, and also reduces the exposure of your consumer key. To get the token, POST a request with the following settings and headers:

Request Example: POST https://api.twitter.com/oauth2/token
Headers: Authorization: Basic (Insert Base-64-Encoded <consumer key>:<secret key>)
Headers: Content-Type:application/x-www-form-urlencoded;charset=UTF-8
Body: grant_type=client_credentials
Response: {"token_type":"bearer","access_token":"AAAAAAAAAAAAAAAA..."}

Making Requests and Parsing the Response

Once the token is acquired, calls to other API endpoints can be immediately performed. Each subsequent call will be made with the token. To get information about any Twitter handle, POST a request with the following settings and headers:

Request Example: GET https://api.twitter.com/1.1/users/show.json?screen_name=<screen_name>
Headers: Authorization: Bearer <token>
Response: 
{
 "contributors_enabled" : false,
 "created_at" : "Sun May 25 07:09:41 +0000 2008", 
 "default_profile" : false,
 "default_profile_image" : false,
 "description" : "We build custom applications for business. Our mission is to make organizations more efficient and effective.", 
 "favourites_count" : 26,
 "follow_request_sent" : null,
 "followers_count" : 303,
  ...
}

This particular use case for automatically getting Twitter followers could be useful to streamline a review process where applicants must have an audience, such as authors, reporters, or podcast creators. There's so much more you can do with the Twitter API.

Conclusion

Use the power of FileMaker to make sense of data from anywhere on Twitter. Track employee engagement, see what the competition is up to, or post tweets directly from your app!

Tweet at us if you found this post helpful - let's have a conversation @dbservices.

Did you know we are an authorized reseller for FileMaker Licensing?
Contact us to discuss upgrading your FileMaker software.

Download
Download the FileMaker Twitter Integration File
Please complete the form below to download your FREE FileMaker file.
FileMaker Experience *
Terms of Use *
OPT-IN: I agree that I am downloading a completely free FileMaker application file with no strings attached. This file is unlocked, and I may use it for my business or organization as I see fit. Because I am downloading a free file, I agree that I should receive occasional marketing. I understand that I can OPT-OUT of these emails at anytime.
Emory Brown thumbnail
Emory Brown

Emory is a Certified FileMaker Developer and former DB Services employee.

FileMaker 18 Certified Developer
FileMaker 17 Certified Developer
FileMaker 16 Certified Developer
FileMaker 15 Certified Developer
FileMaker 14 Certified Developer
FileMaker 13 Certified Developer
FileMaker 12 Certified Developer
FileMaker 11 Certified Developer
"We were actually able to add more features than we thought would be possible within our budget. We always experienced a ‘can do’ attitude and DB Services was incredibly patient and easy to work with."
Courtney Hartman
Art Director
"The new FileMaker custom website interface is very user-friendly and easy to follow for our clients. In addition, it is much faster than the old Instant Web Publishing (IWP) interface. Thank you and all the others who have helped us out at DB Services. I am very grateful for the excellent service you provide us. Its nice to know we can call you for help if we have an issue."
Wayne Capek
President
"We needed a solution that would simplify the administration of our responsibilities under our contract with the State of Indiana. We have seen a dramatic increase across the state in the number of potential foster and adoptive parents that have begun the preparation and training process. This increase has resulted in a significant opportunity for children available for adoption. That’s a big win for everyone! And it’s all because we can refer potential parents to the proper state contacts efficiently and quickly."
Chris Morrison
Executive Director
"Thank you for all of your expertise and valuable help. I am so grateful to have found DB Services."
Linda Findlay
Owner
"Thank you for our new database system. We transitioned from a carbon copy paper based system to a digital database. The software has saved us time and money. We used to archive all our jobs in cabinets, now we can look up a job in seconds from anywhere. The software allows us to easily email estimates to our customers in pdf format. In a year there was a return on investment just from eliminating the purchasing of our carbon forms."
Todd Cartmel
Owner
"The new system allows us to create and track jobs for customers along with inventory, something we had been doing with separate word and spreadsheet files. Because it’s now so intuitive, new staff members are able to begin using the database immediately without our usual training session and ‘cheat sheets’ for getting around within the file."
Tom Andrews
President