Welcome to the API Integration Documentation. The documentation is broken down into the following sections:
Overview
The content you purchase from Brafton is delivered via XML feed. This format is meant to enable our clients to easily automate the process of posting their content to their own sites.
A fundamental prerequisite of deploying Brafton content is to have a site on which to host it. This site should be built on a platform that supports dynamic web development and should have an available data storage solution such as MSSQL or MySQL databases.
After reading this documentation, clients should develop a process to poll the Brafton XML feed at regular intervals, pulling new articles into their data store and updating old ones as needed. The article data can then be used to build out site features like individual article pages, a news landing page, or related article links from various destinations within the site.
In essence, the news data and display pages together comprise a Content Management System (CMS), so some clients may find it best to use a pre-made CMS to handle many of the tasks related to this site building. Brafton has developed a plugin for WordPress that automatically creates posts from articles, allowing for a nearly end-to-end integration.
Getting Started
Have WordPress? If so, check out our plugin for WordPress
- Brafton API Access details – Locate your introduction email which will contain your API Key, API Base URL, and API Root URL. If you cannot find the email please contact Operations Support. You will need these details to access your content via the Brafton API. You should be able to browse your Brafton API Root URL using a web browser such as Firefox as it outputs data in XML format.
- Identify your technology stack and environment – A developer fully familiar with the web sites technology stack is key to a smooth and successful integration. Therefore the first step is to know your technologies. The Preliminary Technical Questionnaire should assist in identifying operating systems, programming languages, database technology etc. If you are using a Content Management System (CMS) to power your site you will need to get familiar with the facilities it provides for integrating third party services (via modules, Plug-ins etc.). Vendor technical documentation may assist you here.
- Download the appropriate Sample Client Library – with a view to reduce the amount of coding required on the clients end, we have developed some sample code that handles the plumbing between a given programming language and our API Web Service – PHP, .Net, and Java samples are available. Usage of these libraries is optional.
- Create a Grabber – Write a script or application (optionally using one of the sample client libraries) to download your content via the Brafton API and store it in a local database accessible by the target website. You should store our unique news item ID along side each article in your database as this will enable you to check if an article has already been downloaded. The logic should be similar to the following.
- Pull the list of latest news item IDs from the API using the sample client library ( or writing your own code to call the web service and parse the XML responses).
- Loop through each news item in the list.
- On each iteration query your database for rows with our news item ID.
- If no rows are returned then it is a new item, insert as a new row into your database.
- If rows are returned then it exists therefore update the existing row (we may have made corrections to a new item).
- Schedule the Grabber – you would want the above process to run automatically at a regular interval. Once every 20 minutes is recommended. It is also ideal if the schedule is set to an odd minute past the hour rather than on the hour e.g. 12:07 rather than 12:00.
- Develop web pages to display the content – Once you have the grabber populating your database with content you are ready to write some code to render the content on your website in a search engine-optimized manner. Your Account Manager will work with you to draw out a detailed spec of the work required on the front end.
Developer Guide
See our complete reference guide (all elements, parameters, etc.)
For a trial and/or testing purposes, there is a feed with sample articles. It is located at http://api.brafton.com/dada3480-9d3b-4989-876a-663fdbe48be8.
For WordPress, Joomla. Drupal, and Blogengine this means selecting the API Domain of Brafton and entering the API Key of dada3480-9d3b-4989-876a-663fdbe48be8
Sample Client Libraries and Plug-ins
- Sample PHP Client Library Reference
- Sample .Net Client Library Reference
- Sample Java Client Library Reference
Tutorials
- Simple database structure
- Advanced database structure
- HOW TO: Save into a local database – PHP + MySQL
- HOW TO: Load from a local database – PHP + MySQL
- HOW TO: Save into a local database – C# + SQL Express
- HOW TO: Create a simple feed reader console application – CSharp.NET
- HOW TO: Save into a local database – ASP.NET + SQL Express