API

Introduction

The site provides the possibility of accessing and querying the collected data in several machine-readable formats (XML, JSON and PHP objects). As an alternative, you can also download all the information "in one click" as a CVS file by visiting the section Download .

How to use the API

The site provides a REST service at http://directory.p2pvalue.eu/rest , allowing the access to the data gathered at the repository at http://directory.p2pvalue.eu/rest/api
The following response formatters are available:

  • XML: Extensible Markup Language.
  • JSON: JavaScript Object Notation.
  • PHP objects: Responses are encoded using the data format emitted by PHPs "serialize()" function.

E.g.: http://directory.p2pvalue.eu/rest/api

By default, the response formatter is XML. You can especify the format by adding .xml | .json | .php to the api call.

E.g.:

REST services

From the CRUD functions, only Read is allowed. Calls withouth parameters return the whole list of nodes.
E.g.: http://directory.p2pvalue.eu/rest/api

You can select an unique node by setting the nid parameter (unique identifier).
E.g.: http://directory.p2pvalue.eu/rest/api?nid=362 - returns the information of the node 362 in XML

You can also perform queries using the different values of the taxonomies.
E.g.: http://directory.p2pvalue.eu/rest/api?languages=%22Spanish%22 returns all the nodes having Spanish as a value for the parameter "languages"

Several parameters can be combined (following and "AND logic")
E.g.: http://directory.p2pvalue.eu/rest/api?languages=%22Spanish%22&legal_enti... returns all the nodes having "Spanish" as a value for the parameter "languages" AND which have a value of "public institution" for the field "legal_entity".

Note: The different taxonomies (and its values) are currently under discussion. Therefore, we cannot offer a fixed list of parameters yet. However, they can be deduced by taking a look at the structure of a node (e.g.: http://directory.p2pvalue.eu/rest/api?nid=362). As a rule of thumb, the parameter name is the same as it appears in the visualisation of a node in the API (e.g. "Software platform license" -> software_platform_license) and the values are the same that appear in the form to contribute information about CBPP communities and are not case sensitive (e.g.: "No license" -> "no license", "No License", "no License", etc.).
E.g.: http://directory.p2pvalue.eu/rest/api?software_platform_license=%22no%20...

There are currently 380 Commons-Based Peer Production cases!