Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
GET - /data/experiments/{session-id}/assessors/{assessor-id}/resources
GET - /data/projects/{project-id}/subjects/{subject-label}/experiments/{session-label}/assessors/{assessor-label}/resources

Parameters

{project-id}Path parameter
{subject-id} or {subject-label}Path parameter. Subject label is a project-specific field, and can only be used if a project is specified.
{session-id} or {session-label}Path parameter. Session label is a project-specific field, and can only be used if a project is specified.
{assessor-id} or {assessor-label}Path parameter. Assessor label is a project-specific field, and can only be used if a project is specified.
format

Optional querystring parameter. Specify the format of the returned response.

  • json (default)
  • html
  • xml
  • csv

Response

This call returns an array of resource descriptors, where the key values are "xnat_abstractresource_id" and "label", which can be used as a path parameter to return individual resource collections.

...

Code Block
GET - /data/experiments/{session-id}/assessors/{assessor-id}/files
GET - /data/projects/{project-id}/subjects/{subject-label}/experiments/{session-label}/assessors/{assessor-label}/files

Parameters

{project-id}Path parameter
{subject-id} or {subject-label}Path parameter. Subject label is a project-specific field, and can only be used if a project is specified.
{session-id} or {session-label}Path parameter. Session label is a project-specific field, and can only be used if a project is specified.
{assessor-id} or {assessor-label}Path parameter. Assessor label is a project-specific field, and can only be used if a project is specified.
format

Optional querystring parameter. Specify the format of the returned response.

  • json (default)
  • html
  • xml
  • csv

Response

This call returns an array of file listings, where each has a unique URI path to the resource file. Note the "out" in the URI path, signifying that the resource is downloadable.

Code Block
{
  "ResultSet": {
    "Columns": [
      {
        "key": "URI",
        "serverRoot": ""
      }
    ],
    "Result": [
      {
        "cat_ID": "integer {resource-id}",
        "collection": "string {resource-label}",
        "file_content": "string",
        "file_format": "string",
        "file_tags": "string",
        "digest": "hash",
        "Name": "string {filename}",
        "Size": "integer",
        "URI": "/data/experiments/{experimentsession-id}/assessors/{assessor-id}/out/resources/{resource-id}/files/{filename}"
      },
      ...
    ],
    "title": "Files"
  }
}


Create A New Experiment Resource Folder

Note: {resource-label} must be new and unique in this assessor. Once created, resource descriptors cannot be modified.

Code Block
PUT - /data/projects/{project-id}/subjects/{subject-label}/experiments/{experiment-label}/assessors/{assessor-label}/resources/{resource-label}
PUT - /data/experiments/{experiment-id}/assessors/{assessor-id}/resources/{resource-label}

Parameters

{project-id}Required path parameter
{subject-id} or {subject-label}Required path parameter
{experiment-id} or {experiment-label}Required path parameter
{resource-label}Required path parameter. Specify the label of the resource that you want to create. XNAT will automatically assign an ID.
format

Optional querystring parameter. Specify a string format descriptor for this resource folder.

tagsOptional querystring parameter. Specify a comma-separated list of tags for this resource folder.
contentOptional querystring parameter. Specify a string description of the resource folder's content.

Response: None


Upload A New Experiment Resource File

Note: {filename}must be unique within this resource folder, otherwise the file will not be uploaded

Code Block
PUT - /data/experiments/{session-id}/assessors/{assessor-id}/{in|out}/resources/{resource-id}/files/{filename}
PUT - /data/projects/{project-id}/subjects/{subject-label}/experiments/{session-label}/assessors/{in|out}/resources/{resource-label}/files/{filename}




Get The Contents Of An Image Assessor Resource File

Note

This URI returns the raw contents of a resource file. If your client cannot parse this file's MIME type, it will not provide a usable output. See How To Download Files via the XNAT REST API for help on downloading resources.


Code Block
GET - /data/projectsexperiments/{projectsession-id}/subjectsassessors/{subjectassessor-id | subject-label}/experiments/{experiment-id | experiment-label{in|out}/resources/{resource-id | resource-label}/files/{filename}
GET - /data/experimentsprojects/{experimentproject-id}/subjects/{subject-label}/experiments/{session-label}/assessors/{in|out}/resources/{resource-idlabel}/files/{filename}

Parameters

{project-id}Path parameter
{subject-id} or {subject-label}Path parameter. Subject label is a project-specific field, and can only be used if a project is specified.
{session-id} or {session-label}Path parameter. Session label is a project-specific field, and can only be used if a project is specified.
{assessor-id} or {assessor-label}Path parameter. Assessor label is a project-specific field, and can only be used if a project is specified.
{in|out}

Path parameter. If you don't know this, query the /files API above to find the URI.

  • "out" is the standard grouping for downloadable resources
  • "in" is the standard grouping for resources meant to be consumed by pipelines or other processes
{resource-id} or {resource-label}Path parameter
{filename}Path parameter

Response:

RAW file content