Flash XML API

Flash XML API

This page explains some of the XML tools built into Webonizer that allow you to use the information you create using Webonizer and present it in an interactive Flash environment. At the current time this documentation is limited to sharing ways to get XML for specific purposes. Documentation on the implementation in Flash is still forthcoming.

The Flash XML class is only available if you have purchased a full license for your Webonizer site. Furthermore, the XML created can be used in other applications than Flash—but we focus on Flash since it is the most commonly used web application that our customers use.

To get the XML for your application, you will call a file at your domain with an address at [INSERT YOUR DOMAIN NAME]/webonizer_core/xmlapi.php . There is only one required parameter to pass through the URL and that is “doctype”. The doctype will determine what kind of documents you will gather.

Another parameter you can pass is “docid”. If you leave out the docid parameter, the XML returned will be a list of XML items that match your doctype. If you enter a valid docid, the document returned will only be of the numeric id contained in docid. For example, if you request www.yourdomainnamehere.com/webonizer_core/xmlapi.php?doctype=article you will get a list of articles. If you request www.yourdomainnamehere.com/webonizer_core/xmlapi.php?doctype=article&docid=1 you will get Article # 1.

You can turn on or off the XML access in your Site Settings control panel. By default, XML access is turned off. You can also require requests for XML to be verified against an accesscode and email address to restrict XML access to only sites/application you have specifically granted.

List of doctypes

The list of doctypes below can be used as the value of the doctype parameter when requesting XML.

  • article – This will return XML that contains documents of the Article class. If no docid is given, a list of articles will be returned (without the body of the article). If docid is passed, that article will be returned with its full content.
  • user – This will return XML that contains documents of the User class (members on the site). If docid is passed, the full profile of the user will be returned. If docid is missing, only the user matching the docid will be returned.
  • event – This will return XML relating to an event. If no docid is given, a list of events will be presented. If a docid is passed, the full event information will be returned.
  • page – This will return XML relating to a page (also called Site Pages and Areas). If no docid is passed, this will return a list of pages. If a docid is passed, the full page relating to that id is returned.
  • topic – This will return XML relating to topics. If no docid is passed, a list of topics will return. If a docid is passed, details about the specific topic are returned.
  • media – This will return XML with information about media files. When a docid is passed, information for a single media file will return. Otherwise, a list of media files will return.
  • guest – This will return XML of guestbook posts.

There are more built-in doctypes that Webonizer does not yet implement but will in the future. Those doctypes include “link”, “geo” and “ind” (links, geographies and industries). Also, plugins can add their own doctypes that can be implemented via this XML class. (For plugin doctypes, refer to the documentation from the plugin provider.)

There are other parameters that can be passed that will affect the information gathered. A list of alternate parameters is listed below as well as an explanation of when each is relevant.

Optional Parameters

  • webonizer_xml_access_accesscode – This parameter is required if your site has turned on the Access Code requirement in the site settings. If required, you will also have to pass 'webonizer_xml_access_email'.
  • webonizer_xml_access_email – This parameter is required if your site has turned on the Access Code requirement in the site settings. If required, you will also have to pass 'webonizer_xml_access_accesscode'.
  • limit – This parameter should be a numeric value that limits the number of results listed items when no docid is passed. If this parameter is not set, it is automatically set to 10.
  • page – This parameter will set what page of results to return for list results (when docid is not included). When this parameter is not passed, the value defaults to 1. The value must be a positive integer.
  • uid – This parameter limits results to those that belong to a specific user (member on the site). The value must be a numeric value. This parameter can be applied to the following doctypes: article, event and media. For example, if passed with a doctype of article, a list of results will only include articles authored by the passed user id.
  • featured – When this parameter is passed, the results returned will only include documents that have been flagged as featured. The parameter is available with the following doctypes: article, media, user, event.
  • promo – When this parameter is passed, the result will only include documents that have been flagged as sponsored.
  • order – This parameter will sort results based on the name of the column passed (in reference to a column in a table in the database). Using this parameter requires an understanding of the structure of the database for the given doctypes. Generally speaking, you should not pass this parameter unless you understand the database structure.
  • dir – This parameter will choose the direction of the sorting. Possible values are ‘ASC’ and ‘DESC’.
  • topic – This parameter will return documents that have been joined to the topic id. For example, if you want only articles that have been joined to Topic 5, set this parameter is set to 5. The value must be numeric and match a topic id. This parameter currently works only with the doctype ‘article’.
  • jointype – This parameter is applied only to the ‘media’ doctype. When passed, the resulting list of media objects will all be associated to doctypes given in this parameter. For example, if jointype is set to “article” then the media returned are all associated to articles. This parameter is most often used with joined (below). Currently, the core values are “article” and “user”, while we are soon to add “event” to this list and plugins can have their own options.
  • joinid – This parameter must be used in conjunction with jointype (above) and only when doctype is set to “media”. If passed as a numeric id representing the id of the doctype passed in jointype, it will limit media results to those that are joined to a specific document. For example, to get all media for Article # 10, you would request www.yourdomain/webonizer_core/xmlapi.php?doctype=media&jointype=article&joinid=10 .
  • name – This parameter will limit results that match your name. Currently this is only used with the “media” doctype. If you pass name as “fami” then media files that have an alt text beginning with “fami” will return, including files such as “family.jpg” and “famine.mp3”.
  • mediatype – This parameter will limit results to media files classified with the given type. Possible values include: PHOTO, GRAPHIC, ART, OTHER, CARTOON, MP3, VIDEO, ZIP.
  • mediamime – This parameter limits media results that are similar to the value passed. For example, if you pass “image” then only files with a mime-type beginning with “image” will return, which includes most image files (JPG,GIF, PNG).
  • articles_exist – This parameter only pertains to the “topic” doctype. If passed, the resulting list of topics are limited to those that have articles associated to them.

Understanding the Webonizer XML Object

Documentation coming soon.

Download Webonizer