Our network

LocalNet Documentation | People

Title (Max 100 Characters)

LocalNet Documentation
People
LocalNet Documentation

I'm glad you're interested in the LocalNet API.  Currently it can retrieve an index of the nodes on a site, either of any type or of a specific type.  This is the only part of the API currently enabled on all sites in production.  I'm working on the ability to create and update nodes, to allow user login/logout and to enable files upload, download, creation and deletion.

Node index requests take the form of http://tracy.news10.net/api/node.json.  These requests do not need authentication and will retrieve nodes in the specified format.  Results are returned in sets of 20.  (This is currently hard-coded but can be customized if needed.)

arguments:

filename extension - can be any of json, xml, yaml, php (serialized variable), rss and bencode.  e.g. api/node.xml will return xml-formatted data.

all_fields - set this to 1 to make all fields available.  This will perform node_load on all nodes and return everything that Drupal knows about a node.  This is a little more resource-intensive than the default, but is also much more useful.  example: api/node.json?all_fields=1

fields - comma-separated list of fields to return.  This is useful for limiting the size of a response.  Look at what a request returns to see which fields are available.  Unknown fields are ignored. example: api/node.json?all_fields=1&fields=nid,type

parameters - limit the results returned.  This acts like a simplified search for over the fields that are returned when all_fields=0.  For example, api/node.xml?parameters[nid]=12345 will return node 12345, api/node.json?parameters[uid]=333 will return all fields by user 333 and api/node.json?parameters[type]=photogallery will return all photo galleries.

page - Results are returned in sets of 20 by order of creation, starting with the most recent.  Set page=n to get the nth page.  example: api/node.json?page=1234
 

People