welcome to the api integration documentation. the documentation is broken down into the following sections:
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.
have wordpress? if so, check outour 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 contactoperations 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, andjavasamples 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.
see ourcomplete reference guide(all elements, parameters, etc.)
for a trial and/or testing purposes, there is a feed with sample articles. it is located athttp://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
- 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