/data/archive/config/{TOOL_NAME}/{PATH_TO_FILE}

HTTP CommandRequest & Response format
GET: REQ 
GET: RESP

html
json
xml
csv

PUT: REQBODY contents is the contents of the configuration
PUT: RESP

201 CREATED on succcessful creation

200 OK on successful replacement.

500 on error

Description

GET: Retrieves one Configuration or an empty set. The Configuration represents the most recent configuration file stored at the supplied path. Use the querystring parameters specified below to control return values.

This URI returns a static set of columns (they cannot be customized by the client).

column namedescription
toolThe name of a tool that has configuration files
paththe path to the configuration file
userThe user who created the configuration
create_dateThe date/time the configuration was created
reasonThe user provided reason for uploading the configuration
contentsThe actual contents of the configuration file
versionversion number of the configuration contents
statusenabled/disabled status

Parameters

    
formatGEToptionalUser can specify the format of the returned data set, by adding the ?format= parameter at the end of the URI. Options are HTML, JSON, XML, or CSV.
action=getHistoryGEToptionalReturn a list of Configurations or an empty set. The list includes all versions stored at this path ordered by date added. This returns all metadata and contents for each Configuration.
contents=trueGET Return only the contents (no metadata) of the most recent configuration stored at this path as a String. "format" is ignored. If no configuration exists, simply return an empty string.
meta=trueGET Returns one Configuration or an empty set. The Configuration includes only the meta data of the most recent configuration stored at this path.
meta=true&contents=trueGET same as/REST/config/{tool-name}/{PATH/TO/FILE}
version={version id}GETcontents & meta optionalReturn one Configuration or an empty set. The Configuration returned represents the one configuration that matches this tool, path, and version number. Version numbers can be found in the meta-data for each Configuration. Additional querystring parameters "contents" and "meta" are available. If contents=true this will return the String representation of the Configuration contents. Format is ignored. If meta=true this will return the Configuration with no contents.
status={enabled,disabled)PUToptionalupdate the status for the most current configuration. Returns 200 OK on success.

Examples

The following REST URL on XNAT Central ...

https://central.xnat.org/REST/config/anon/script

... will produce this table of results, which is formatted as HTML by default.

toolpathprojectusercreate_datereasoncontentsversionstatus
anonscript admin2012-06-20 09:35:58.234 (0008,1030) := project (0010,0010) := subject (0010,0020) := session11enabled

Other Formats

You can retrieve a result set in XML, CSV, or JSON format as well by appending a tag on the end of the URL. For example, this REST URL on XNAT Central ...

https://central.xnat.org/REST/config/anon/script?format=json

... will produce a JSON-formatted result string.

{"ResultSet":{"Result":[{"project":"","create_date":"2012-06-20 09:35:59.546","status":"enabled","contents":"(0008,1030) := project\n(0010,0010) := subject\n(0010,0020) := session\n","reason":"","tool":"anon","path":"script","user":"admin","version":"1"}]}}

$label.name