Data Sharing API
Data sharing and permissions in XNAT are a complex topic. For more detail on what sharing behaviors are supported in XNAT, see https://flywheelio.atlassian.net/wiki/spaces/XNAT17/pages/2507546194.
Share Subject And Its Experiments Into A New Project
PUT - /data/projects/{original-project-id}/subjects/{subject-id | subject-label}/projects/{shared-project-id}
Parameters
{original-project-id} | Required path parameter. Specify the ID of the project that owns a given subject. |
---|---|
{subject-id} or {subject-label} | Required path parameter. |
{shared-project-id} | Required path parameter. Specify the ID of the project that you intend a subject to be shared into. Logged-in user must have ownership permissions in the shared project. |
label | Optional querystring parameter. Specify a new label for this subject that will be used in the shared project, if desired. |
primary | Optional querystring parameter.
Logged-in user must have ownership permissions in both projects to change the primary ownership. |
format | Optional querystring parameter. Specify the format of the returned response.
|
Response Codes
200 | OK |
---|---|
403 | Forbidden – User does not have permission to perform the requested operation |
404 | Not Found – Project ID not recognized |
409 | Conflict – Attempting to write data into an XNAT object that already exists |
Response Format
Returns the subject metadata from the original project
Get A List Of Shared Projects Associated With A Subject
This query will return a list of all projects associated with a subject. The root project ID in the URI can be either a project that owns the subject or a shared project.
GET - /data/projects/{project-id}/subjects/{subject-id | subject-label}/projects
Parameters
{project-id} | Required path parameter |
---|---|
{subject-id} or {subject-label} | Required path parameter |
format | Optional querystring parameter. Specify the format of the returned response.
|
Response Format
Displaying JSON results. Note that the response does not specify which project owns a subject.
{
"ResultSet": {
"Result": [
{
"label": "string",
"ID": "string",
"Secondary_ID": "string",
"Name": "string"
},
...
]
}
}
Share An Experiment Into A New Project
Sharing an experiment by itself has no effect if the subject that owns the experiment is not also shared.
|
Parameters
{original-project-id} | Required path parameter. Specify the ID of the project that owns a given subject. |
---|---|
{subject-id} or {subject-label} | Required path parameter. |
{experiment-id} or {experiment-label} | Required path parameter. |
{shared-project-id} | Required path parameter. Specify the ID of the project that you intend a subject to be shared into. Logged-in user must have ownership permissions in the shared project. |
label | Optional querystring parameter. Specify a new label for this experiment that will be used in the shared project, if desired. |
primary | Optional querystring parameter.
Logged-in user must have ownership permissions in both projects to change the primary ownership. |
Response Codes
200 | OK |
---|---|
403 | Forbidden (User does not have permission to perform the requested operation) |
404 | Project Not Found |
409 | Conflict Found – Attempting to share data into an object that already exists |
Response Format
Returns the experiment accession ID as a string
Get A List Of Shared Projects Associated With An Experiment
GET - /data/projects/{original-project-id}/subjects/{subject-id | subject-label}/experiments/{experiment-id | experiment-label}/projects
Parameters
{original-project-id} | Required path parameter. Specify the ID of the project that owns a given subject. |
---|---|
{subject-id} or {subject-label} | Required path parameter. |
{experiment-id} or {experiment-label} | Required path parameter. |
format | Optional querystring parameter. Specify the format of the returned response.
|
Response
Displaying JSON results. Note that the response does not specify which project owns an experiment.
{
"ResultSet": {
"Result": [
{
"label": "string",
"ID": "string",
"Secondary_ID": "string",
"Name": "string"
},
...
]
}
}
Sharing Image Assessors into a new project does not have much effect unless you share the subject record as well. See Subject Sharing API.
Share An Image Assessor Into A New Project
PUT - /data/projects/{original-project-id}/subjects/{subject-id}/experiments/{session-id}/assessors/{assessor-id}/projects/{shared-project-id}
Parameters
{original-project-id} | Required path parameter. Specify the ID of the project that owns a given image assessor. |
---|---|
{subject-id} or {subject-label} | Required path parameter. |
{experiment-id} or {experiment-label} | Required path parameter. |
{assessor-id} or {assessor-label} | Required path parameter. |
{shared-project-id} | Required path parameter. Specify the ID of the project that you intend a subject to be shared into. Logged-in user must have ownership permissions in the shared project. |
label | Optional querystring parameter. Specify a new label for this assessor that will be used in the shared project, if desired. |
primary | Optional querystring parameter.
Logged-in user must have ownership permissions in both projects to change the primary ownership. |
Response Codes
200 | OK |
---|---|
403 | Forbidden (User does not have permission to perform the requested operation) |
404 | Project Not Found |
409 | Conflict Found – Attempting to share data into an object that already exists |
Response Format
Returns the assessor's experiment accession ID as a string
Get A List Of Shared Projects Associated With An Image Assessor
GET - /data/projects/{original-project-id}/subjects/{subject-id}/experiments/{session-id}/assessors/{assessor-id}/projects
Parameters
{original-project-id} | Required path parameter. Specify the ID of the project that owns a given image assessor. |
---|---|
{subject-id} or {subject-label} | Required path parameter. |
{session-id} or {session-label} | Required path parameter. |
{assessor-id} or {assessor-label} | Required path parameter. |
format | Optional querystring parameter. Specify the format of the returned response.
|
Response
Displaying JSON results. Note that the response does not specify which project owns an experiment
{
"ResultSet": {
"Result": [
{
"label": "string",
"ID": "string",
"Secondary_ID": "string",
"Name": "string"
},
...
]
}
}