The Action Word Workspace REST API is built on top of the Squash TM REST API. It provides additional services related to the action word workspace.

Action Words

get Get all action words

A GET to /action-words returns all the action words the user is allowed to read.

HTTP request

GET /api/rest/latest/action-words?page=1&size=3 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)

Example response

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

{
  "_embedded" : {
    "action-words" : [ {
      "_type" : "action-word",
      "id" : 87,
      "word" : "I write \"login\" in login",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/action-words/87"
        }
      }
    }, {
      "_type" : "action-word",
      "id" : 88,
      "word" : "I write \"password\" in password",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/action-words/88"
        }
      }
    }, {
      "_type" : "action-word",
      "id" : 89,
      "word" : "I log in",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/action-words/89"
        }
      }
    } ]
  },
  "_links" : {
    "first" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words?page=0&size=3"
    },
    "prev" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words?page=0&size=3"
    },
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words?page=1&size=3"
    },
    "next" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words?page=2&size=3"
    },
    "last" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words?page=3&size=3"
    }
  },
  "page" : {
    "size" : 3,
    "totalElements" : 10,
    "totalPages" : 4,
    "number" : 1
  }
}

Response fields

Path Type Description

_embedded.action-words

Array

the list of elements for that page

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements the user is allowed to read

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 Get action words of project

A GET to /projects/{id}/action-words returns all the action words contained in the given project.

HTTP request

GET /api/rest/latest/projects/14/action-words?page=2&size=3 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)

Example response

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

{
  "_embedded" : {
    "action-words" : [ {
      "_type" : "action-word",
      "id" : 121,
      "word" : "I have \"number\" oranges in my basket",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/action-words/121"
        }
      }
    }, {
      "_type" : "action-word",
      "id" : 122,
      "word" : "I eat \"number\" oranges",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/action-words/122"
        }
      }
    }, {
      "_type" : "action-word",
      "id" : 124,
      "word" : "There are \"number\" oranges left in my basket",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/action-words/124"
        }
      }
    } ]
  },
  "_links" : {
    "first" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/action-words?page=0&size=3"
    },
    "prev" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/action-words?page=1&size=3"
    },
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/action-words?page=2&size=3"
    },
    "next" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/action-words?page=3&size=3"
    },
    "last" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14/action-words?page=3&size=3"
    }
  },
  "page" : {
    "size" : 3,
    "totalElements" : 10,
    "totalPages" : 4,
    "number" : 2
  }
}

Response fields

Path Type Description

_embedded.action-words

Array

the list of elements for that page

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements the user is allowed to read

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 Get action word

A GET to /action-words/{id} returns the action word with the given id.

HTTP request

GET /api/rest/latest/action-words/721 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

Example response

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

{
  "_type" : "action-word",
  "id" : 721,
  "word" : "The color of the icon \"iconName\" is \"color\".",
  "description" : "Action word describing the color of an icon.",
  "project" : {
    "_type" : "project",
    "id" : 6,
    "name" : "my project",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/projects/6"
      }
    }
  },
  "created_by" : "Arthur",
  "created_on" : "2020-08-15T07:48:02.000+00:00",
  "last_modified_by" : "Arthur",
  "last_modified_on" : "2020-08-15T07:53:11.000+00:00",
  "last_implementation_technology" : "ROBOT",
  "last_implementation_date" : "2020-09-06T09:35:47.000+00:00",
  "parameters" : [ {
    "_type" : "action-word-parameter",
    "id" : 3,
    "name" : "iconName",
    "default_value" : "home"
  }, {
    "_type" : "action-word-parameter",
    "id" : 4,
    "name" : "color",
    "default_value" : "green"
  } ],
  "test_cases" : [ {
    "_type" : "keyword-test-case",
    "id" : 476,
    "name" : "User interface icons colors",
    "reference" : "UX-17",
    "importance" : "MEDIUM",
    "status" : "APPROVED"
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words/721"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/6"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the action word

word

String

the action itself with its parameters

description

String

the description of the action word

last_implementation_technology

String

the automation framework used for the last implementation of the action word

last_implementation_date

String

the date when the action word was last implemented

created_by

String

the user who created this action word

created_on

String

the date the action word was created

last_modified_by

String

the user who last modified the action word

last_modified_on

String

the date the action word was last modified

project

Object

the project the action word belongs to

parameters

Array

the parameters of the action word

test_cases

Array

the test cases which use this action word

_links

Object

related links

Relation Description

self

link to the action word

project

link to the project of the action word

post Create action word

A POST to /action-words creates a new action word.

HTTP request

POST /api/rest/latest/action-words HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 216
Host: localhost:8080

{
  "_type" : "action-word",
  "word" : "The color of the icon \"iconName\" is \"color\".",
  "description" : "Action word describing the number of icons.",
  "project" : {
    "_type" : "project",
    "id" : 6
  }
}

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

Example response

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

{
  "_type" : "action-word",
  "id" : 721,
  "word" : "The color of the icon \"iconName\" is \"color\".",
  "description" : "Action word describing the color of an icon.",
  "project" : {
    "_type" : "project",
    "id" : 6,
    "name" : "my project",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/projects/6"
      }
    }
  },
  "created_by" : "Arthur",
  "created_on" : "2020-08-15T07:48:02.000+00:00",
  "parameters" : [ {
    "_type" : "action-word-parameter",
    "id" : 3,
    "name" : "iconName",
    "default_value" : "home"
  }, {
    "_type" : "action-word-parameter",
    "id" : 4,
    "name" : "color",
    "default_value" : "green"
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words/721"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/6"
    }
  }
}

patch Modify action word

A PATCH to /action-words/{id} modifies the action word with the given id.

HTTP request

PATCH /api/rest/latest/action-words/721 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 94
Host: localhost:8080

{
  "_type" : "action-word",
  "description" : "Action word describing the number of icons."
}

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

Example response

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

{
  "_type" : "action-word",
  "id" : 721,
  "word" : "There are \"iconCount\" displayed.",
  "description" : "Action word describing the number of icons.",
  "project" : {
    "_type" : "project",
    "id" : 6,
    "name" : "my project",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/projects/6"
      }
    }
  },
  "created_by" : "Arthur",
  "created_on" : "2020-08-15T07:48:02.000+00:00",
  "last_modified_by" : "Arthur",
  "last_modified_on" : "2020-09-02T12:36:17.000+00:00",
  "last_implementation_technology" : "ROBOT",
  "last_implementation_date" : "2020-09-06T09:35:47.000+00:00",
  "parameters" : [ {
    "_type" : "action-word-parameter",
    "id" : 3,
    "name" : "iconCount",
    "default_value" : "5"
  } ],
  "test_cases" : [ {
    "_type" : "keyword-test-case",
    "id" : 476,
    "name" : "User interface icons colors",
    "reference" : "UX-17",
    "importance" : "MEDIUM",
    "status" : "APPROVED"
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/action-words/721"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/6"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the action word

word

String

the action itself with its parameters

description

String

the description of the action word

last_implementation_technology

String

the automation framework used for the last implementation of the action word

last_implementation_date

String

the date when the action word was last implemented

created_by

String

the user who created this action word

created_on

String

the date the action word was created

last_modified_by

String

the user who last modified the action word

last_modified_on

String

the date the action word was last modified

project

Object

the project the action word belongs to

parameters

Array

the parameters of the action word

test_cases

Array

the test cases which use this action word

_links

Object

related links

delete Delete action words

A DELETE to /action-words/{ids} deletes the action word(s) with the given id(s).

HTTP request

DELETE /api/rest/latest/action-words/14,38,278,1247 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Path parameters

Table 1. /api/rest/latest/action-words/{ids}
Parameter Description

ids

the list of ids of the action words

Example response

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

"The action words with the following identifiers were not deleted because they are used in at least one test step : 14, 124714, 278"