Comments pinned to coordinates of a map, served from
/new_api/projects/{projectId}/maps/{mapId}/comments.
1. Get comment
Returns info about comment.
1.1. HTTP request
GET /minerva/new_api/projects/Some_id/maps/371/comments/12 HTTP/1.1
1.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
comment identifier |
1.3. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/Some_id/maps/371/comments/12' -X GET \
-H 'Authorization: Bearer xxxxxxxx'
1.4. HTTP response
HTTP/1.1 200 OK
1.5. Response Fields
| Path | Type | Description |
|---|---|---|
|
|
unique comment identifier |
|
|
map identifier |
|
|
comment content |
|
|
identifier of the author |
|
|
email of the author |
|
|
why the comment has been removed |
|
|
x coordinate where the comment is located on map |
|
|
y coordinate where the comment is located on map |
|
|
is comment deleted |
|
|
is comment visible |
1.6. Sample Response
{
"deleted" : false,
"id" : 12,
"content" : "it's cool",
"coordinates" : {
"x" : 10.0,
"y" : 20.0
},
"map" : 371,
"visible" : false,
"authorId" : null,
"email" : null,
"removeReason" : ""
}
2. Add comment
Pins a comment to a point of the map given by coordinates.x and coordinates.y - a comment is
attached to a location, not to any element or reaction. Besides the content the request carries
the reporter email and a visible flag deciding whether the content is shown to other users.
2.1. HTTP request
POST /minerva/new_api/projects/empty/maps/3/comments/ HTTP/1.1
2.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
2.3. Request Fields
| Path | Type | Description |
|---|---|---|
|
|
text of the comment |
|
|
x coordinate on the map |
|
|
y coordinate on the map |
|
|
is content visible |
|
|
reported email address |
2.4. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/empty/maps/3/comments/' -X POST \
-H 'Authorization: Bearer xxxxxxxx' \
-d '{"content":"blah blah blah","email":"test@test.com","coordinates":{"x":10.0,"y":12.0},"visible":true}' \
-H 'Content-Type: application/json'
2.5. HTTP response
HTTP/1.1 201 Created
2.6. Response Fields
| Path | Type | Description |
|---|---|---|
|
|
unique comment identifier |
|
|
map identifier |
|
|
comment content |
|
|
identifier of the author |
|
|
email of the author |
|
|
why the comment has been removed |
|
|
x coordinate where the comment is located on map |
|
|
y coordinate where the comment is located on map |
|
|
is comment deleted |
|
|
is comment visible |
2.7. Sample Response
{
"deleted" : false,
"id" : 11,
"content" : "blah blah blah",
"coordinates" : {
"x" : 10.0,
"y" : 12.0
},
"map" : 3,
"visible" : true,
"authorId" : 1,
"email" : "test@test.com",
"removeReason" : ""
}
3. Delete comment
Marks the comment as removed instead of erasing it: the comment is kept with deleted set to
true and the optional reason from the request body stored as removeReason. It stops being
returned to ordinary users, while curators and admins can still list it.
|
Note
|
Supports optimistic locking via the If-Match header.
|
3.1. HTTP request
DELETE /minerva/new_api/projects/Some_id/maps/372/comments/13 HTTP/1.1
3.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
comment identifier |
3.3. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/Some_id/maps/372/comments/13' -X DELETE \
-H 'Authorization: Bearer xxxxxxxx' \
-d '{"reason":"xyz"}' \
-H 'Content-Type: application/json'
3.4. HTTP response
HTTP/1.1 200 OK
4. List comments
Returns the comments pinned to the map. Ordinary
users see only comments that are visible and not removed; curators and admins additionally see
hidden and removed ones together with the author and removal details, and can narrow the result to
one or the other with the removed query parameter.
|
Note
|
The result is paged - use the page and size query parameters to
walk through it.
|
4.1. HTTP request
GET /minerva/new_api/projects/Some_id/maps/373/comments/ HTTP/1.1
4.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
4.3. Query Parameters
| Parameter | Description |
|---|---|
|
index of the page to fetch, counted from 0; 0 by default |
|
number of entries on a page; 20 by default, 10000 at most |
|
filter by removal state; available only to curators and administrators, other users always see non removed comments only |
4.4. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/Some_id/maps/373/comments/' -X GET \
-H 'Authorization: Bearer xxxxxxxx'
4.5. HTTP response
HTTP/1.1 200 OK
4.6. Response Fields
| Path | Type | Description |
|---|---|---|
|
|
list of comments on the page |
|
|
unique comment identifier |
|
|
map identifier |
|
|
comment content |
|
|
identifier of the author |
|
|
email of the author |
|
|
why the comment has been removed |
|
|
x coordinate where the comment is located on map |
|
|
y coordinate where the comment is located on map |
|
|
is comment deleted |
|
|
is comment visible |
|
|
total number of pages |
|
|
total number of elements |
|
|
number of elements on this page |
|
|
page size |
|
|
page number |
4.7. Sample Response
{
"content" : [ {
"deleted" : false,
"id" : 14,
"content" : "it's cool",
"coordinates" : {
"x" : 10.0,
"y" : 20.0
},
"map" : 373,
"visible" : false,
"authorId" : null,
"email" : null,
"removeReason" : ""
} ],
"totalPages" : 1,
"totalElements" : 1,
"numberOfElements" : 1,
"size" : 20,
"number" : 0
}