Project API
Get a listing of all projects
Returns a listing of all projects in your XNAT.
GET /data/projects
Parameters:
Parameter | Description | Data Type |
---|---|---|
format | Optional querystring parameter. Set the format of the response. Format value can be json, html, xml, or csv. If not specified, default is JSON | string |
accessible | Optional querystring parameter. Restrict the list of projects to those that are accessible to the currently logged in user. This is a catchall for any project group that the user may be assigned to. Default is false. | boolean |
owner | Optional querystring parameter. Restrict the list of projects to those where the currently logged in user is listed as an owner. Default is false. | boolean |
member | Optional querystring parameter. Restrict the list of projects to those where the currently logged in user is listed as a member. Default is false. | boolean |
collaborator | Optional querystring parameter. Restrict the list of projects to those where the currently logged in user is listed as a collaborator. Default is false. | boolean |
activeSince | Optional querystring parameter. Restrict the list of projects to those who have been updated since the specified date. Date format is YYYY-MM-DD | date |
recent | Optional querystring parameter. Restrict the list of projects to those who have been recently accessed by the logged in user. Default is false | boolean |
favorite | Optional querystring parameter. Restrict the list of projects to those in the current user's "favorites" list. | boolean |
Response:
[
{
description: "string",
ID: "string",
name: "string",
pi_firstname: "string"
pi_lastname: "string",
secondary_ID: "string",
URI: "path"
}
]
Create one or more projects
This POST form accepts an XML file specifying project parameters. See available project parameters.
POST /data/projects
Parameters:
Parameter | Description | Data Type |
---|---|---|
Model | Project parameters that can be specified in an XML document. Please note that XML schema:
| XML |
Response Codes:
HTTP Status Code | Message |
---|---|
201 | Project successfully created. |
400 | The submitted data was invalid. |
401 | Must be authenticated to access the XNAT REST API. |
404 | Not Found |
409 | Project already exists |
500 | An unexpected error occurred. |
Get information on a specific project
Returns project metadata for a single project, specified by ID.
GET /data/projects/{id}
Parameters:
Parameter | Description | Data Type |
---|---|---|
id | Required path parameter. Project ID (value of | string |
format | Optional querystring parameter. Set the format of the response. If not specified, HTML for the project report page will be returned (and displayed if using a web browser) | string: json, html, xml, csv |
Update parameters for a specific project
Allows the user to edit project metadata by passing values through the querystring, or as XML data.
PUT /data/projects/{id}
Parameters:
Parameter | Description | Data Type |
---|---|---|
id | Required path parameter. Project ID (value of | string |
Model | Project parameters that can be specified in an XML document, or as values encoded in the querystring. Please note that XML schema:
| XML |
Response Codes:
HTTP Status Code | Message |
---|---|
200 | Project successfully updated. |
400 | The submitted data was invalid. |
401 | Must be authenticated to access the XNAT REST API. |
404 | Not found. |
409 | Request conflicts with existing projects |
500 | An unexpected error occurred. |
Delete a project
This operation is permanent and cannot be undone.
DELETE /data/projects/{id}
Response:
HTTP Status Code | Message |
---|---|
200 | Project deleted. |
401 | Must be authenticated to access the REST API. |
404 | Not found. |
500 | An unexpected error occurred. |