Skip to content

Get comments about a study

gerome12 edited this page Apr 23, 2020 · 4 revisions

Used to get comments (private and public) about a study. For getting comments, the user must have minimum one series.

URL : /studies/{StudyInstanceUID}/comments

Method : GET

Auth Required : Authorization with a JWT Bearer token with the user as the sub claim. The user must be am admin or an user with "comments" permission.

Headers

  • Accept : If present, require that this value be application/json
  • Content-Type : Must be : application/x-www-form-urlencoded

Parameters

  • limit={limit} (Optional)
  • offset={offset} (Optional)

Success Response

  • Status : 200 OK

Comments are sorted by descending date.

[
    {
        "event_type": "Comment",
         "source": {
            "email": "user1@domaine.com",
            "name": "user1 name",
            "sub": "c2fd0b66-dac4-4b98-9341-d4f3b303bd4e",
            "can_access": true
        },
        "comment": "second comment",
        "post_date": "2018-09-23T06:59:01",
        "is_private": true,
        "target": {
            "email": "user2@domaine.com",
            "name": "user2 name",
            "sub": "d4f3b303bd4e-4b98-dac4-9341-c2fd0b66",
            "can_access": true
        }
    },
    {
        "event_type": "Comment",
         "source": {
            "email": "user1@domaine.com",
            "name": "user1 name",
            "sub": "c2fd0b66-dac4-4b98-9341-d4f3b303bd4e",
            "can_access": true
        },
        "comment": "first comment",
        "post_date": "2018-09-21T06:59:02",
        "is_private": false
    },
    {...}
]

The response is a JSON array of comments.
Comments can be : private or public.
Public comment :

{
    "event_type": "Comment",
    "source": {
        "email": "user1@domaine.com",
        "name": "user1 name",
        "sub": "c2fd0b66-dac4-4b98-9341-d4f3b303bd4e",
        "can_access": true
    },
    "comment": "first comment",
    "post_date": "2018-09-21T06:59:02",
    "is_private": false
}

Private comment :

{
    "event_type": "Comment",
    "source": {
        "email": "user1@domaine.com",
        "name": "user1 name",
        "sub": "c2fd0b66-dac4-4b98-9341-d4f3b303bd4e",
        "can_access": true
    },
    "comment": "second comment",
    "post_date": "2018-09-23T06:59:01",
    "is_private": true,
    "target": {
        "email": "user1@domaine.com",
        "name": "user1 name",
        "sub": "c2fd0b66-dac4-4b98-9341-d4f3b303bd4e",
        "can_access": true
    }
}

Error Response

If the user is not found.
If the study is not found.

  • Status : 404 Not Found

If parameters are bad (limit=-4).

  • Status : 400 Bad Request
Clone this wiki locally