Info List Items

This chapter focuses on info list items.

Get info list item

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

HTTP request

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

Path parameters

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

id

the id of the info list item

HTTP response

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

{
  "_type" : "info-list-item",
  "id" : 3,
  "label" : "item3",
  "code" : "codeItem3",
  "icon_name" : "cross",
  "colour" : "#ff0000",
  "default" : true,
  "info_list" : {
    "_type" : "info-list",
    "id" : 4,
    "label" : "list4",
    "description" : "description4",
    "code" : "code4",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/info-lists/4"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/info-list-items/3"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the entity

label

String

the label of the info list item

code

String

the code of the info list item

icon_name

String

the name of the icon of the info list item

colour

String

the colour of the info list item (hexadecimal)

default

Boolean

boolean which indicates if the info list item is the default one

info_list

Object

the info list this item is part of

_links

Object

related links

Relation Description

self

link to this info list item

Create info list item

A POST to /info-lists/{id}/items creates a new info list item.

HTTP request

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

{
  "_type" : "info-list-item",
  "label" : "item4",
  "code" : "codeItem4",
  "icon_name" : "cross",
  "colour" : "#ff0000"
}

Path parameters

Table 1. /api/rest/latest/info-lists/{id}/items
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 item

code

String

the code of the info list item

icon_name

String

the name of the icon of the info list item

colour

String

the colour of the info list item (hexadecimal)

HTTP response

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

{
  "_type" : "info-list-item",
  "id" : 4,
  "label" : "item4",
  "code" : "codeItem4",
  "icon_name" : "cross",
  "colour" : "#ff0000",
  "default" : true,
  "info_list" : {
    "_type" : "info-list",
    "id" : 5,
    "label" : "create5",
    "description" : "description5",
    "code" : "code5",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/info-lists/5"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/info-list-items/4"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the info list item

label

String

the label of the info list item

code

String

the code of the info list item

icon_name

String

the name of the icon of the info list item

colour

String

the colour of the info list item (hexadecimal)

default

Boolean

boolean which indicates if the info list item is the default one

info_list

Object

the info list this item is part of

_links

Object

related links

Relation Description

self

link to this info list item

Modify info list item

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

HTTP request

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

{
  "_type" : "info-list-item",
  "label" : "item4",
  "code" : "codeItem4",
  "icon_name" : "cross",
  "colour" : "#0000ff",
  "default" : true
}

Path parameters

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

id

the id of the info list item

Request fields

Path Type Description

_type

String

the type of the entity

label

String

the label of the info list item

code

String

the code of the info list item

icon_name

String

the name of the icon of the info list item

colour

String

the colour of the info list item (hexadecimal)

default

Boolean

boolean which indicates if the info list item is the default one

HTTP response

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

{
  "_type" : "info-list-item",
  "id" : 4,
  "label" : "item4",
  "code" : "codeItem4",
  "icon_name" : "cross",
  "colour" : "#0000ff",
  "default" : true,
  "info_list" : {
    "_type" : "info-list",
    "id" : 5,
    "label" : "list5",
    "description" : "description5",
    "code" : "code5",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/info-lists/5"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/info-list-items/4"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the info list item

label

String

the label of the info list item

code

String

the code of the info list item

icon_name

String

the name of the icon of the info list item

colour

String

the colour of the info list item (hexadecimal)

default

Boolean

boolean which indicates if the info list item is the default one

info_list

Object

the info list this item is part of

_links

Object

related links

Relation Description

self

link to this info list item

Delete info list item

A DELETE to /info-list-items/{id} deletes the info list item with the given id.

If the info list item to delete is the default one, then it cannot be deleted.

HTTP request

DELETE /api/rest/latest/info-list-items/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Path parameters

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

id

the id of the info list item

HTTP response

HTTP/1.1 204 No Content