Ning Developer Network

Ning Developer Admin

XML Operations

Ning REST API XML-Format Operations

This document covers all Ning REST API operations that take and return XML data. The relative URLs for these operation endpoints uniformly begin with /xn/atom/. Details of the data formats used can be found on the REST API XML Representations page. Note that there are also REST API operations which use keyword and JSON-formatted data and have endpoint URLs that specify /xn/rest/ ; the documentation for these can be found on the JSON-Format Operations page.

Authentication

Any operation that creates, updates, or deletes data can only be performed by the owner of the target app. In order to authenticate the operation:

  1. It must be performed over SSL (i.e. using an https:// rather than http:// URL)
  2. Authentication credentials must be sent according to the HTTP Basic Authentication standard. (At present Ning does not support Digest authentication)

If an operation is not properly authenticated with the app owner's credentials, the Playground will return a 403 Forbidden status.

For GET operations which do not need to be authenticated, unencrypted HTTP can be used. Include the parameter xn_auth=no in the query string to circumvent Ning's cookie-based authentication system and make an anonymous request.

Error Responses

For responses that indicate an error, Ning returns the appropriate HTTP status code along with a body that contains a plaintext English description of the error. (This may change in the future to provide more structured error responses.)

Contacts and Messaging

API access to Ning's contacts and messaging features is currently only available through the JSON-format API. Check the JSON-Format Operations page for more information.

Writing App and Profile Metadata

While the endpoints listed below can be used to fetch App and user profile metadata, writing back changes to this metadata is currently only possible through the JSON-format API. Check the JSON-Format Operations page for more information.

Endpoints

The table below describes the full set of available endpoints and their associated operations. To generate the full URL for an endpoint, use this template:

{http|https}://{app}.ning.com/xn/atom/1.0{endpoint}

Resource Operation Request Body Method Endpoint Comments
Content Create <entry/> POST /content
Content Update <entry/> PUT /content(C) Content which matches the selector C is replaced with the new representation. Currently, only selectors of type id = X are supported.
Content Delete - DELETE /content(C) Content which matches the selector C is deleted.
Currently, only selectors of type id = X are supported.
Content Query - GET /content(C) Returns a feed of content entries.
Content Rollup Query - GET /content(C)/rollup(R) Returns a feed of <xn:rollup/>s containing the content selected by C rolled-up as described by R
Application Query - GET /application Returns a feed containing an entry describing the current application.
Application Query - GET /application/children Returns a feed containing entries describing the current application's children.
Application Query - GET /application/parent Returns a feed containing an entry describing the current application's parent.
Profile Query - GET /profile(P) Returns a feed of profiles matching selector P
Tag Create <entry><xn:tag/>+</entry> POST /content(C)/tag Applies the provided tags to the content matching selector C.
Tag Delete - DELETE /content(C)/tag(T) Deletes the tags which match selector T from the content which matches the selector C
Tag Query - GET /content(C)/tag Returns a feed of tags for content matching selector C
Tag Rollup Query - GET /tag(T)/rollup(R) Returns a feed of <xn:rollup/>s containing the tags selected by T rolled-up as described by R
Role Create <xn:role/> POST /role Adds the specified role to applications matching selector A
Role Create <xn:role/> POST /profile(P)/role Adds the specified role to profiles matching selector P in applications matching selector A
Role Delete - DELETE /role(R) Deletes the roles matching selector R from applications matching selector A
Role Delete - DELETE /profile(P)/role(R) Deletes the roles matching selector R from profiles matching selector P in applications matching selector A.
Role Query - GET /role Returns a feed of <xn:role/>s in applications matching selector A.
Role Query - GET /role(R)/profile Returns a feed of profile entries that have role R in applications matching selector A
Role Query - GET /profile(P)/role Returns a feed of <xn:role/>s for profile P in applications matching selector A

Binary Object Creation

To create a content object containing binary content such as an image, music file, or video, POST to the /content endpoint described above. However, the request is structured a bit differently:

  • The body of the request is not an Atom entry but instead the raw binary content.
  • The request must have a Content-Type header containing the MIME type of the binary content, such as image/png, audio/mp3, or video/mp4.
  • The request URL must have a binary=true parameter in its query string.
  • The request URL must have a type=ContentObjectType parameter in its query string. ContentObjectType is the type you want assigned to the content object that gets created.
  • The request URL may have a title=title parameter in its query string to set the title of the created content object to title.
  • The request URL may have a summary=summary parameter in its query string to set the description of the created content object to summary.
  • The request URL may have a private=true parameter in its query string make the created content object private. If this parameter is not present, the created content object will be public.

Last updated by Ernie H. Jun 13.

Documentation & Tips

© 2008   Created by Ning Developer Admin

Badges  |  Report an Issue  |  Privacy  |  Terms of Service