Glyphs (images uploaded to a project and drawn on its maps), served from /new_api/projects/{projectId}/glyphs.

1. Add glyph

Uploads an image file to the project and returns info about the created glyph.

1.1. HTTP request

POST /minerva/new_api/projects/test_project/glyphs/ HTTP/1.1

1.2. Path Parameters

Table 1. /minerva/new_api/projects/{projectId}/glyphs/
Parameter Description

projectId

project identifier

1.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/glyphs/' -X POST \
    -H 'Authorization: Bearer xxxxxxxx' \
    -F 'file=@filename.png'

1.4. HTTP response

HTTP/1.1 201 Created

1.5. Response Fields

Path Type Description

id

Number

unique glyph identifier

file

Number

attached file identifier

filename

String

attached file name

1.6. Sample Response

{
  "id" : 24,
  "file" : 144
}

2. List glyphs

Returns the images uploaded to the project - a glyph is a picture file that is drawn on a map by referencing its id, either from a layer image or as the glyph representing an element. Each entry carries the filename the picture was uploaded under; the picture itself is downloaded from the glyph file content endpoint.

Note
The result is paged - use the page and size query parameters to walk through it.

2.1. HTTP request

GET /minerva/new_api/projects/test_project/glyphs/?page=0&size=5 HTTP/1.1

2.2. Path Parameters

Table 2. /minerva/new_api/projects/{projectId}/glyphs/
Parameter Description

projectId

project identifier

2.3. Query Parameters

Parameter Description

page

index of the page to fetch, counted from 0; 0 by default

size

number of entries on a page; 20 by default, 10000 at most

2.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/glyphs/?page=0&size=5' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

2.5. HTTP response

HTTP/1.1 200 OK

2.6. Response Fields

Path Type Description

content

Array

list of glyphs on the page

content[].id

Number

unique glyph identifier

content[].file

Number

attached file identifier

content[].filename

String

attached file name

totalPages

Number

total number of pages

totalElements

Number

total number of elements

numberOfElements

Number

number of elements on this page

size

Number

page size

number

Number

page number

2.7. Sample Response

{
  "content" : [ {
    "id" : 25,
    "file" : 145,
    "filename" : "test_file.png"
  }, {
    "id" : 26,
    "file" : 146,
    "filename" : "test_file.png"
  } ],
  "totalPages" : 1,
  "totalElements" : 2,
  "numberOfElements" : 2,
  "size" : 5,
  "number" : 0
}

3. Download glyph file content

Returns the picture itself - the bytes of the file the glyph was uploaded from. The Content-Type is derived from the extension of the original file name (image/png, image/gif, image/jpeg), and anything else is served as application/octet-stream. Responses are cacheable for a day (Cache-Control: max-age=86400), as the content of a glyph never changes.

Requires IS_ADMIN or READ_PROJECT authority for the given project.

3.1. HTTP request

GET /minerva/new_api/projects/test_project/glyphs/27/file_content HTTP/1.1

3.2. Path Parameters

Table 3. /minerva/new_api/projects/{projectId}/glyphs/{glyphId}/file_content
Parameter Description

projectId

project identifier

glyphId

glyph identifier

3.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/glyphs/27/file_content' -X GET \
    --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx"

3.4. HTTP response

HTTP/1.1 200 OK