Info Lists

This chapter focuses on info lists.

Get all info lists

A GET to /info-lists returns all the info lists.

HTTP request

GET /api/rest/latest/info-lists?page=0&size=20 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

page

number of the page to retrieve (optional)

size

size of the page to retrieve (optional)

sort

which attributes of the returned entities should be sorted on (optional)

fields

which fields of the elements should be returned (optional)

type

which type of the element should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1914

{
  "_embedded" : {
    "info-lists" : [ {
      "_type" : "info-list",
      "id" : 1,
      "label" : "list1",
      "description" : "description1",
      "code" : "code1",
      "items" : [ {
        "_type" : "info-list-item",
        "id" : 21,
        "label" : "item1",
        "code" : "codeItem1",
        "icon_name" : "cross",
        "colour" : "#ff0000",
        "default" : true,
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/info-list-items/21"
          }
        }
      } ],
      "created_by" : "admin",
      "created_on" : "2020-04-06T10:00:00.000+00:00",
      "last_modified_by" : "admin",
      "last_modified_on" : "2020-04-06T10:00:00.000+00:00",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/info-lists/1"
        }
      }
    }, {
      "_type" : "info-list",
      "id" : 2,
      "label" : "list2",
      "description" : "description2",
      "code" : "code2",
      "items" : [ {
        "_type" : "info-list-item",
        "id" : 22,
        "label" : "item2",
        "code" : "codeItem2",
        "icon_name" : "cross",
        "colour" : "#ff0000",
        "default" : true,
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/info-list-items/22"
          }
        }
      } ],
      "created_by" : "admin",
      "created_on" : "2020-04-06T10:00:00.000+00:00",
      "last_modified_by" : "admin",
      "last_modified_on" : "2020-04-06T10:00:00.000+00:00",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/info-lists/2"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/info-lists?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 2,
    "totalPages" : 1,
    "number" : 0
  }
}

Response fields

Path Type Description

_embedded.info-lists

Array

the list of elements for that page

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements

page.totalPages

Number

how many pages can be browsed

page.number

Number

the page number

_links

Object

related links

Relation Description

first

link to the first page (optional)

prev

link to the previous page (optional)

self

link to this page

next

link to the next page (optional)

last

link to the last page (optional)

Get info list

A GET to /info-lists/{id} returns the info list with the given id.

HTTP request

GET /api/rest/latest/info-lists/3 HTTP/1.1
Accept: application/json
Host: localhost:8080

Path parameters

Table 1. /api/rest/latest/info-lists/{id}
Parameter Description

id

the id of the info list

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 705

{
  "_type" : "info-list",
  "id" : 3,
  "label" : "list3",
  "description" : "description3",
  "code" : "code3",
  "items" : [ {
    "_type" : "info-list-item",
    "id" : 23,
    "label" : "item3",
    "code" : "codeItem3",
    "icon_name" : "cross",
    "colour" : "#ff0000",
    "default" : true,
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/info-list-items/23"
      }
    }
  } ],
  "created_by" : "admin",
  "created_on" : "2020-04-06T10:00:00.000+00:00",
  "last_modified_by" : "admin",
  "last_modified_on" : "2020-04-06T10:00:00.000+00:00",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/info-lists/3"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the entity

_type

String

the type of the entity

label

String

the label of the info list

description

String

the description of the info list

code

String

the code of the info list

items

Array

the items of the info list

created_by

String

the user who created the info list

created_on

String

the creation date of the info list

last_modified_on

String

the last user who modified the info list

last_modified_by

String

the last modification date of the info list

_links

Object

related links

Relation Description

self

link to this info list

Create info list

A POST to /info-lists creates a new info list.

HTTP request

POST /api/rest/latest/info-lists HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 282
Host: localhost:8080

{
  "_type" : "info-list",
  "label" : "create4",
  "code" : "code4",
  "description" : "description4",
  "items" : [ {
    "_type" : "info-list-item",
    "label" : "item4",
    "code" : "codeItem4",
    "icon_name" : "cross",
    "colour" : "#ff0000",
    "default" : true
  } ]
}

Request fields

Path Type Description

_type

String

the type of the entity

label

String

the label of the info list

code

String

the status of the info list

description

String

the description of the info list

items

Array

the info list’s items

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 619

{
  "_type" : "info-list",
  "id" : 4,
  "label" : "create4",
  "description" : "description4",
  "code" : "code4",
  "items" : [ {
    "_type" : "info-list-item",
    "id" : 24,
    "label" : "item4",
    "code" : "codeItem4",
    "icon_name" : "cross",
    "colour" : "#ff0000",
    "default" : true,
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/info-list-items/24"
      }
    }
  } ],
  "created_by" : "admin",
  "created_on" : "2020-04-06T10:00:00.000+00:00",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/info-lists/4"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the info list

label

String

the label of the info list

code

String

the status of the info list

description

String

the description of the info list

items

Array

an array of info list items

created_by

String

user who created the entity

created_on

String

timestamp of the creation (ISO 8601)

_links

Object

related links

Relation Description

self

link to this info list

Modify info list

A PATCH to /info-lists/{id} modifies the info list with the given id.

HTTP request

PATCH /api/rest/latest/info-lists/4 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 280
Host: localhost:8080

{
  "_type" : "info-list",
  "label" : "list4",
  "code" : "code4",
  "description" : "description4",
  "items" : [ {
    "_type" : "info-list-item",
    "label" : "item4",
    "code" : "codeItem4",
    "icon_name" : "cross",
    "colour" : "#ff0000",
    "default" : true
  } ]
}

Path parameters

Table 1. /api/rest/latest/info-lists/{id}
Parameter Description

id

the id of the info list

Request fields

Path Type Description

_type

String

the type of the entity

label

String

the label of the info list

code

String

the status of the info list

description

String

the description of the info list

items

Array

an array of info list items

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 705

{
  "_type" : "info-list",
  "id" : 4,
  "label" : "list4",
  "description" : "description4",
  "code" : "code4",
  "items" : [ {
    "_type" : "info-list-item",
    "id" : 24,
    "label" : "item4",
    "code" : "codeItem4",
    "icon_name" : "cross",
    "colour" : "#ff0000",
    "default" : true,
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/info-list-items/24"
      }
    }
  } ],
  "created_by" : "admin",
  "created_on" : "2020-04-06T10:00:00.000+00:00",
  "last_modified_by" : "admin",
  "last_modified_on" : "2020-04-06T10:00:00.000+00:00",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/info-lists/4"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the info list

label

String

the label of the info list

code

String

the status of the info list

description

String

the description of the info list

items

Array

an array of info list items

created_by

String

user who created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user who modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

_links

Object

related links

Relation Description

self

link to this info list

Delete info list

A DELETE to /info-lists/{ids} deletes the info list(s) with the given id(s).

If associated with at least one project, the objects will permanently be disassociated with the info list(s). The default list will be activated and the values associated to the objects will be reset to the default 'Undefined' value.

HTTP request

DELETE /api/rest/latest/info-lists/2,3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Path parameters

Table 1. /api/rest/latest/info-lists/{ids}
Parameter Description

ids

the ids of the info list to delete

HTTP response

HTTP/1.1 204 No Content