Next: Access Your Ning App with Your Favorite Programming Language > >
The Ning REST API lets you create instant Atom feeds from the public content and metadata of any Ning App and without writing a single line of PHP. You can use them to subscribe to the content of the Apps that you use, or to export data for backing up. Even better, you can create feeds from queries that only return the data you want.
Ning Apps store their data as objects in the Ning Content Store. Up until now, the only way to query and use that data was to write PHP code that used the Ning Core API and host it on the Playground. With the Ning REST API, anyone can turn Content Store objects and queries into subscribable feeds just by typing a URL.
(Note: These feeds should work fine in your browser, but may not
work in a feed reader or other external code due to authentication cookies.
Don't worry, there's a fix: just add xn_auth=no& after
the first ? (question mark) in the feed URL.)
Using the REST API query syntax, you can create feeds of...
http://confess.ning.com/xn/atom/1.0/content?order=published@Dhttp://discussion.ning.com/xn/atom/1.0/content(type='Message')?order=published@D&from=0&to=5http://qa.ning.com/xn/atom/1.0/content(my.questionID=863709)?order=published@Dhttp://wishlist.ning.com/xn/atom/1.0/content(author='yoz'&type='Wish')?Even better, if you target api.ning.com with your query, you can
search the entire Ning Content Store:
http://api.ning.com/atom/1.0/content(title%20likeic%20'frog')?http://api.ning.com/atom/1.0/tag(value='england')/content?http://api.ning.com/atom/1.0/content?order=published@D(Note that you should omit the /xn before the /atom
in the URL path when using api.ning.com.)
One of the neatest tricks for which you can use App metadata is listing the clones (or "children") of a given App. We demonstrated this in our ETech conference presentation with an App whose children know about each other. If you look at the box in the lower-left corner of this page, you'll see a list similar to this one:
The first App in that list, Yoz's
New York Trip, is the parent App from which the others are cloned.
The details of the parent App can be retrieved by the child App by fetching
the Atom entry at this URL:
http://bobnewyorktrip.ning.com/xn/atom/1.0/application/parent
Once the name of the parent App has been fetched, the details of the
children of that App can be fetched from the feed at this URL:
http://yoznewyorktrip.ning.com/xn/atom/1.0/application/children
The complete details of how to access Ning App metadata, along with all the other API features we've demonstrated, are available in the API documentation.
Next: Access Your Ning App with Your Favorite Programming Language > >