Pages

Monday, May 5, 2014

The FORUMS libre web API

In addition to being able to embed your forum on your own website, and access them from any Android device, you can also access your forums through the FORUMS libre web API. The web API gives you the advantage of having complete control of your forum's client interface.

You can use the web API to access your forum from your own website through JavaScript, PHP or any other language. You can also use the web API to create your own mobile application to access your forum, such as an Android or iOS application.

A web API, is a set of HTTP GET/POST URI's that allow sending and receiving of message data. When you browse a website, your browser makes a series of HTTP GET/POST requests to URIs that return HTML content. In a web service the URIs return XML or JSON data, instead of HTML content.

The FORUMS libre web API provides a REST API with XML message content. The API takes HTTP POST XML data, and returns XML data.

HTTP XML POST API

  • http://www.forumslibre.com/rest/forumslibre/create-user
  • http://www.forumslibre.com/rest/forumslibre/check-user
  • http://www.forumslibre.com/rest/forumslibre/get-forums
  • http://www.forumslibre.com/rest/forumslibre/get-forum-posts
  • http://www.forumslibre.com/rest/forumslibre/check-forum
  • http://www.forumslibre.com/rest/forumslibre/check-forum-post
  • http://www.forumslibre.com/rest/forumslibre/create-forum-post
  • http://www.forumslibre.com/rest/forumslibre/create-reply
  • http://www.forumslibre.com/rest/forumslibre/update-forum-post

create-user

The create-user API creates a new user, and returns the user's details.

URI: http://www.forumslibre.com/rest/forumslibre/create-user
Parameters: application, user, password, hint, name, showName, email, website, bio

XML POST Example

check-user

The check-user API validates a user, and returns the user's details.

URI: http://www.forumslibre.com/rest/forumslibre/check-user
Parameters: application, user, password, token

Parameters

applicationREQUIRED: The application ID.
userREQUIRED: The ID of the user.
passwordREQUIRED: The password of the user. A token can also be used.
tokenREQUIRED: The token of the user. A token can be obtained through check-user, and is valid until reset.

XML POST Example

get-forums

The get-forums API queries the details for all forums matching the criteria.

URI: http://www.forumslibre.com/rest/forumslibre/get-forums
Parameters: application, user, password, token, type, tag, category, sort, typeFilter, filter.

XML POST Example

get-forum-posts

The get-forum-posts API queries the details for all forum posts matching the criteria.

URI: http://www.forumslibre.com/rest/forumslibre/get-forum-posts
Parameters: application, user, password, instance, token, type, tag, category, sort, typeFilter, filter.

XML POST Example

check-forum

The check-forum API validates that a forum ID or name exists, and returns the forum's details.

URI: http://www.forumslibre.com/rest/forumslibre/check-forum
Parameters: application, user, password, token, id, name

Parameters

applicationREQUIRED: The application ID.
userOPTIONAL: The ID of the user. The user must be registered with FORUMS libre. If not passed the user will be anonymous. The user is required if the forum is private.
passwordOPTIONAL: The password of the user. A token can also be used.
tokenOPTIONAL: The token of the user. A token can be obtained through check-user, and is valid until reset.
idREQUIRED: The ID of the forum to validate. The forum's name can also be used, but the ID is better as it is guaranteed to be unique.
nameREQUIRED: The name of the forum to validate. The forum's ID can also be used.

XML POST Example

check-forum-post

The check-forum-post API validates that a forum post ID exists, and returns the forum post's details.

URI: http://www.forumslibre.com/rest/forumslibre/check-forum-post
Parameters: application, user, password, token, id

XML POST Example

create-forum-post

The create-forum-post API creates a new forum post, the post details with its ID is returned. You must pass the ID of the forum posting to.

URI: http://www.forumslibre.com/rest/forumslibre/create-forum-post
Parameters: application, user, password, token, forum, topic, details, tags

XML POST Example

create-reply

The create-reply API creates a new forum reply, the reply details with its ID is returned. You must pass the ID of the forum post replying to.

URI: http://www.forumslibre.com/rest/forumslibre/create-reply
Parameters: application, user, password, token, parent, details

XML POST Example

update-forum-post

The update-forum-post API updates a existing forum post, the post details with its ID is returned. You must pass the ID of the forum post you are updating.

URI: http://www.forumslibre.com/rest/forumslibre/update-forum-post
Parameters: application, user, password, token, id, topic, details, tags

XML POST Example

So, that is the basic web API. You can now build your own interface for your forum. You can use the API on your own website, or in your own mobile application.

No comments:

Post a Comment