HomeSupportSample .NET Client Library Reference

Overview

This Sample Client Library (language binding) can be used to interact with the API in an object oriented manner using .Net code such as vb.net and C#. The library wraps up sending requests and parsing the XML responses into objects.

The full source code (in vb.net and C#) is available from the download links below.

There’s a collection of sample applications here, that further illustrate how to utilize this Client Library.

[Jump to top]

Download

[Jump to top]

Example

string API_Key = "YOUR_API_KEY"; // your unique API_Key as provided via email
string apiBaseUrl = "YOUR_API_BASE_URL"; // your base URL as provided via email
ApiContext ac = new ApiContext(API_Key, apiBaseUrl);

[Jump to top]

APIContext Class Reference

This is the main class which provides the core methods to interact with your feed and return several collections of objects related to your feed i.e. news items, category definitions and latest comments.

[ Constructor ]

APIContext(String API_KEY, String BaseUrl)

  • Description: APIContext Class contructor.
  • Parameter – API_KEY: your unique API key.
  • Parameter – BaseUrl: the base url provided to you

APIContext(System.Guid API_KEY, String BaseUrl)

  • Description: APIContext Class contructor.
  • Parameter – API_KEY: your unique API key as Guid type.
  • Parameter – BaseUrl: the base url provided to you
  • Exceptions: XMLLoadException

APIContext()

  • Description: APIContext Class contructor.
  • Exceptions: XMLLoadException
[ Properties ]
  • News: IEnumerable – get a collection of news item objects for the feed

[Jump to top]

newsItem Class Reference

[ Properties ]
  • byLine: String – author of the news article
  • categories: IEnumerable – array of category objects associated with the news article
  • clientQuote: String – quote text from the client relating to this item.
  • comments: IEnumerable – array of comment objects associated with the news article
  • createdDate: Date – system autogenerated date when the item was created
  • encoding(): String – character encoding system used eg. UTF-8
  • extract(): String – a summary of the news article
  • format(): String – format of text content either HTML or RAW
  • headline(): String – the news article headline
  • htmlMetaDescription(): String – value for the description meta tag for the news article
  • htmlMetaKeywords(): String – value for the keywords meta tag for the news article
  • htmlMetaLanguage(): String – value for the language meta tag of the news article
  • htmlTitle(): String – value for the html title element
  • id(): int – primary key. the unique news article id
  • lastModifiedDate():: Date – date article was last modified
  • photos(): IEnumerable – array of photo objects associated with the news article
  • priority(): int – priority flag 30 = high, normal = 20 used to prioritise news
  • publishDate(): Date – date article was published
  • source(): String – original source of the article
  • state(): enumeratedTypes.enumNewsItemState – current state of the article eg LIVE / APPROVAL / DRAFT / DELETED
  • tags(): String – a comma separated list of free text tags
  • text(): String – text content of the news article
  • tweetText(): String – special 140 character twitter version of the news article

[Jump to top]

category Class Reference

[ Properties ]
  • id(): int – the unique category id
  • name(): String – the text name of the category

[Jump to top]

photo Class Reference

[ Properties ]
  • htmlAlt(): String – text which can be used in the alternative text attribute for the image
  • Instances(): IEnumerable – get Custom PhotoInstance of the photograph
  • id(): int – the unique photo id
  • orientation(): enumeratedTypes.enumPhotoOrientation – orientation of photo either PORTRAIT or LANDSCAPE

[Jump to top]

photo.photoInstance Class Reference

[ Properties ]
  • height(): int – the height in pixels of this instance of the image
  • url(): String – the URL that points to the source location of this instance of the image
  • width(): int – the width in pixels of this instance of the image
  • type(): enumeratedTypes.enumPhotoInstanceType – the type of photo eg. Thumbnail, Large, HighRes, Custom

[Jump to top]

comment Class Reference

[ Properties ]
  • text(): String – the comment text
  • id(): int – the unique comment id
  • location(): String – geographic location information for the comment
  • postDate(): Date – date when the comment was submitted
  • name(): String – name of commentor

[Jump to top]