This chapter focuses on types of links between requirements.

A GET to /requirement-link-types returns all the link types.

GET /api/rest/latest/requirement-link-types HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
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/1.1 200 OK
Content-Type: application/json
Content-Length: 1066

{
  "_embedded" : {
    "requirement-version-link-types" : [ {
      "_type" : "requirement-version-link-type",
      "id" : 1,
      "role1" : "Role1 link1",
      "role1_code" : "Role1 code link1",
      "role2" : "Role2 link1",
      "role2_code" : "Role2 code link1",
      "default" : false,
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/requirement-link-types/1"
        }
      }
    }, {
      "_type" : "requirement-version-link-type",
      "id" : 2,
      "role1" : "Role1 link2",
      "role1_code" : "Role1 code link2",
      "role2" : "Role2 link2",
      "role2_code" : "Role2 code link2",
      "default" : false,
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/requirement-link-types/2"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-link-types?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 2,
    "totalPages" : 1,
    "number" : 0
  }
}
Path Type Description

_embedded.requirement-version-link-types

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)

A GET to /requirement-link-types/{id} returns the link type with the given id.

Table 1. /api/rest/latest/requirement-link-types/{id}
Parameter Description

id

the id of the link type

GET /api/rest/latest/requirement-link-types/1 HTTP/1.1
Accept: application/json
Host: localhost:8080
Parameter Description

fields

which fields of the elements should be returned (optional)

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

{
  "_type" : "requirement-version-link-type",
  "id" : 1,
  "role1" : "Role1",
  "role1_code" : "Role 1 code",
  "role2" : "Role2",
  "role2_code" : "Role 2 code",
  "default" : false,
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-link-types/1"
    }
  }
}
Path Type Description

_type

String

the type of the entity

id

Number

the id of the link type

role1

String

the first role of the link between requirement

role1_code

String

the first role code

role2

String

the second role of the link between requirement

role2_code

String

the second role code

default

Boolean

the default link type

_links

Object

related links

Relation Description

self

link to this link type

A GET to /requirement-link-types returns the link type with the given code role.

GET /api/rest/latest/requirement-link-types?codeRole=Role1code HTTP/1.1
Accept: application/json
Host: localhost:8080
Parameter Description

codeRole

role code of the link to search

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

{
  "_type" : "requirement-version-link-type",
  "id" : 1,
  "role1" : "Role1",
  "role1_code" : "Role1code",
  "role2" : "Role2",
  "role2_code" : "Role2code",
  "default" : false,
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-link-types/1"
    }
  }
}
Path Type Description

_type

String

the type of the entity

id

Number

the id of the milestone

role1

String

the first role of the link between requirement

role1_code

String

the first role code

role2

String

the second role of the link between requirement

role2_code

String

the second role code

default

Boolean

the default link type

_links

Object

related links

Relation Description

self

link to this link type

A POST to /requirement-link-types creates a new link type.

POST /api/rest/latest/requirement-link-types HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 108
Host: localhost:8080

{
  "role1" : "Role1",
  "role1_code" : "Role 1 code",
  "role2" : "Role2",
  "role2_code" : "Role 2 code"
}
Path Type Description

role1

String

the first role of the link between requirement (mandatory)

role1_code

String

the first role code (mandatory)

role2

String

the second role of the link between requirement (mandatory)

role2_code

String

the second role code (mandatory)

Parameter Description

fields

which fields of the elements should be returned (optional)

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

{
  "_type" : "requirement-version-link-type",
  "id" : 1,
  "role1" : "Role1",
  "role1_code" : "Role 1 code",
  "role2" : "Role2",
  "role2_code" : "Role 2 code",
  "default" : false,
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-link-types/1"
    }
  }
}
Path Type Description

_type

String

the type of the entity

id

Number

the id of the milestone

role1

String

the first role of the link between requirement

role1_code

String

the first role code

role2

String

the second role of the link between requirement

role2_code

String

the second role code

default

Boolean

the default link type

_links

Object

related links

Relation Description

self

link to this milestone

A PATCH to /requirement-link-types/{id} modifies the link type with the given id.

PATCH /api/rest/latest/requirement-link-types/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 136
Host: localhost:8080

{
  "role1" : "Update role1",
  "role1_code" : "Update role 1 code",
  "role2" : "Update role2",
  "role2_code" : "Update role 2 code"
}
Table 1. /api/rest/latest/requirement-link-types/{id}
Parameter Description

id

the id of the link type

Path Type Description

role1

String

the first role of the link between requirement

role1_code

String

the first role code

role2

String

the second role of the link between requirement

role2_code

String

the second role code

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

{
  "_type" : "requirement-version-link-type",
  "id" : 1,
  "role1" : "Update role1",
  "role1_code" : "Update role 1 code",
  "role2" : "Update role2",
  "role2_code" : "Update role 2 code",
  "default" : false,
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/requirement-link-types/1"
    }
  }
}

A DELETE to /requirement-link-types/{ids} deletes one or several link type(s) with the given id(s).

Table 1. /api/rest/latest/requirement-link-types/{ids}
Parameter Description

ids

the list of ids of the link type

DELETE /api/rest/latest/requirement-link-types/11%2012 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
HTTP/1.1 204 No Content