4theFile logo
Home | My Account | Register

The 4theFile Integration Center

4theFile is all about using email Resources with other sites and applications. Here are some approaches to integrating 4theFile with your favorite site, starting with the simplest:

Cut'n'Paste Integration

You can use 4theFile to add value to your existing application, without any new code. If integration doesn't require any code, is it still integration? Hard to say. But it's kinda cool anyway.

Your user asks: "Can I post an email message in the Notes field of Application Z?"

Your old answer: "Well, um, you might be able to, um..." (because you know that they're going to have problems with formatting, and with attachments, and with forwarded messages, and they're going to lose or mangle the headers, etc.)

Your new answer: "Yes. Forward your email to submit@4thefile.com. You'll get back a URL; just paste it into the Notes field."

Using a Simple Collection

Here's a different approach to the Application Z problem...
  1. You (the Application Z support person) log into your 4theFile.com account and set up a shareable Collection with custom email address, for example applicationz@4theFile.com.
  2. Go to Application Z and post a link to the shareable URL for the Collection, which will look something like this: http://4thefile.com/collection/nV4wRRrx/
  3. Any emails sent to applicationz@4theFile.com will automatically show up on the Collection list.
  4. (extra credit) Use different Tags in the same Collection for notes on different records in Application Z. The list of Resources in the Collection that match the tag has its own URL -- the regular collection URL, with /<tag> on the end, like this: http://4thefile.com/collection/nV4wRRrx/tag1.

Using a Collection Callback Link

If you're a developer or webmaster and willing to get your hands a little dirty, you can take it one step further and provide tighter integration and better security by providing a "Collection Callback Link" for your Collection. This is a link to your site that's included in the email sent to the submitter by 4theFile, along with your explanation of what the link does. 4theFile automatically appends the Resource and Collection keys and Tags to the URL. When the user clicks on the callback link, you can ask them to log in and authenticate themseves and authorize use of the 4theFile Resource in your application.

Implement the Callback Link like this:
  1. Provide a script in your application's web interface that can process a GET request with query parameters similar to these ?collectionkey=sJ6Wp2Kn&tag=9723&resourcekey=sbHw4b2c and do something useful. For example, the script might use those parameters to generate a form for creating an entry in the note field for record 9723 in Application Z that contains a link to the 4theFile Resource with URL https://4thefile.com/sbHw4b2c. You'll probably want to require authentication, and allow access only to users that are authorized to add notes to record 9723.
  2. Set up your Collection with privacy "private" and a Collection callback link containing the URL for your new script.
  3. Instruct your users (or provide mailto: links) to submit emails to the Collection's email address, e.g. applicationz+9723@4thefile.com.
  4. The response email 4theFile.com sends the user will contain the callback link with the collectionkey, tag, and resourcekey query parameters added automatically. The user can click the link, authenticate into your system using the authentication mechanism you already have in place and complete and submit the form (which is prepopulated with the Resource link) on your server.

The 4theFile API

The 4theFile API is a REST-style API that uses simple standard technologies: HTTP requests with Basic auth, and XML or JSON response content. The API is designed primarily to allow developers and maintainers of web applications to easily provide an email interface to their applications and integrate the list of submitted emails into their application's interface -- without all the hassles involved in running an email server and parsing complex multi-part email messages, possibly with inline images, html, and attachments. 4theFile takes care of all the messy stuff for you.

For more information, view the 4theFile API Docs on the support wiki:

The API is simple to use, but it allows a much greater degree of control over your Collection than simply linking to a shareable Collection URL. By setting your Collection privacy to "private" and using the API to fetch the Collection list from within an access-controlled page in your application, you can verify that the users viewing the list are authenticated in your application and authorized to view the list.