|
SimalRESTAPI
The Simal REST API
Phase-Design IntroductionThis page describes the Simal REST API. Note that by default the REST API is accessible by anyone. If you wish to secure it your only option, at the time of writing, is to use .htaccess see below for more details. DetailsURL StructureAll REST URLs are of the same form: http://foo.com/simal-rest/COMMAND/NAME_VALUE_PAIRS/FORMAT Where COMMAND is the command you wish to execute, NAME_VALUE_PAIRS is zero or more parameter names and value pairs and FORMAT is a format code that specifies the format of the response document. NAME_VALUE_PAIRS take the form of name-value. For example, to provide a project identifier you would use something like project-prj126. Name value pairs can be provided in any order. FormatCurrently, only json and xml are supported as valid data FORMATs. Project DataAdd a projectTo add a project using a DOAP POST to: http://foo.com/simal-rest/addProject The RDF project data should be contained in a parameter called rdf . Retrieve a Single ProjectTo retrieve the details of a single project use: http://foo.com/simal-rest/project/project-ID/FORMAT Where ID is the project identifier and FORMAT is an approved format. Retrieve a featured projectBy calling the method to retrieve a single project with an ID of "featured" you will retrieve a single featured project. All ProjectsTo retrieve all projects from the standard SIMAL repository use: http://foo.com/simal-rest/allProjects/FORMAT Person DataRetrieve a Single PersonTo retrieve the details of a single person use: http://foo.com/simal-rest/person/person-ID/FORMAT Where ID is the person identifier and FORMAT is an approved format. All Colleagues of a PersonA colleague is defined as someone who works on any of the projects our target person works on. To retrieve all colleagues from the standard SIMAL repository use: http://foo.com/simal-rest/allColleagues/person-ID/FORMAT Where ID is replaced with the Simal ID of the person we are interested in. Retrieve all PeopleTo retrieve the details of all people use: http://foo.com/simal-rest/allPeople/FORMAT Alternative Data SourcesSimal can retrieve data from sources other than the standard Simal repository. Such as the MyExperiment social networking tool for scientific research. In order to use alternative data sources use the "source" parameter as follows: http://foo.com/simal-rest/allColleagues/source-myExperiment/PERSON-ID/FORMAT SecuringAt present there are no security features for the REST API, therefore, if you need to lock it down then you need to use .htaccess. For example, in httpd.conf add: ProxyPass /simal-rest ! To block all direct access to port 8080: iptables -A INPUT -j DROP -p tcp --destination-port 8080 -i eth0 | |