Users
This chapter focuses on additional services for the users. These services extend driven-by-id methods implemented in the Rest Services API by allowing search by User login.
Get all users
A GET
to /users
returns all the users.
HTTP request
GET /api/rest/latest/users?page=2&size=1 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
|
which type of the element should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 894
{
"_embedded" : {
"users" : [ {
"_type" : "user",
"id" : 486,
"login" : "User-1",
"active" : true,
"group" : "User",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/486"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/users?page=0&size=1"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/users?page=1&size=1"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users?page=2&size=1"
},
"next" : {
"href" : "http://localhost:8080/api/rest/latest/users?page=3&size=1"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/users?page=4&size=1"
}
},
"page" : {
"size" : 1,
"totalElements" : 5,
"totalPages" : 5,
"number" : 2
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Get user
A GET
to /users/login/{login}
returns the user with the given login.
Path parameters
Parameter | Description |
---|---|
|
the login of the user |
HTTP request
GET /api/rest/latest/users/login/User-1 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 566
{
"_type" : "user",
"id" : 486,
"first_name" : "Charles",
"last_name" : "Dupond",
"login" : "User-1",
"email" : "charlesdupond@aaaa.aa",
"active" : true,
"group" : "User",
"can_delete_from_front" : true,
"teams" : [ ],
"last_connected_on" : "2018-02-11T11:00:00.000+00:00",
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/486"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the user |
|
|
the type of the entity |
|
|
the first name of the user |
|
|
the last name of the user |
|
|
the login of the user |
|
|
the email address of the user |
|
|
whether the user is activate or not |
|
|
the group of the user belong (admin or user) |
|
|
whether the user can delete library entities from the front-end with the Squash TM Premium plugin |
|
|
the team of the user participate |
|
|
the date of this user was last connected |
|
|
the user who created this user account |
|
|
the date of this user account was created |
|
|
the user who last modified this user account |
|
|
the date of this user account was last modified |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Create user
A POST
to /users
creates a new user.
HTTP request
POST /api/rest/latest/users HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 214
Host: localhost:8080
{
"_type" : "user",
"first_name" : "Charles",
"last_name" : "Dupond",
"login" : "User-1",
"password" : "123456",
"email" : "charlesdupond@aaaa@aa",
"group" : "User",
"can_delete_from_front" : true
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the first name of the user |
|
|
the last name of the user |
|
|
the login of the user |
|
|
the password of the user |
|
|
the email address of the user |
|
|
the group of the user belong (admin, user or testAutomationServer) |
|
|
whether the user can delete library entities from the front-end with the Squash TM Premium plugin |
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 566
{
"_type" : "user",
"id" : 987,
"first_name" : "Charles",
"last_name" : "Dupond",
"login" : "User-1",
"email" : "charlesdupond@aaaa.aa",
"active" : true,
"group" : "User",
"can_delete_from_front" : true,
"teams" : [ ],
"last_connected_on" : "2018-03-05T11:00:00.000+00:00",
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/987"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the user |
|
|
whether the user is activate or not |
|
|
the team of the user participate |
|
|
the date of this user was last connected |
|
|
the user who created this user account |
|
|
the date of this user account was created |
|
|
the user who last modified this user account |
|
|
the date of this user account was last modified |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this user |
Modify user
A PATCH
to /users/{id}
modifies the user with the given id.
Warning
|
Once a user has been created with the Test Automation Server group, it is no longer possible to modify this group. Similarly, it is not possible to modify a user in the User or Administrator group for the Test Automation Server group. |
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
HTTP request
PATCH /api/rest/latest/users/987 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 236
Host: localhost:8080
{
"_type" : "user",
"first_name" : "Charles",
"last_name" : "Dupond",
"login" : "User-42",
"password" : "123456",
"email" : "charlesdupond@bbbb@bb",
"active" : false,
"group" : "User",
"can_delete_from_front" : false
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the first name of the user |
|
|
the last name of the user |
|
|
the login of the user |
|
|
the password of the user |
|
|
the email address of the user |
|
|
whether the user is activate or not |
|
|
the group of the user belong (admin, user or testAutomationServer) |
|
|
whether the user can delete library entities from the front-end with the Squash TM Premium plugin |
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 569
{
"_type" : "user",
"id" : 987,
"first_name" : "Charles",
"last_name" : "Dupond",
"login" : "User-42",
"email" : "charlesdupond@bbbb.bb",
"active" : false,
"group" : "User",
"can_delete_from_front" : false,
"teams" : [ ],
"last_connected_on" : "2018-03-05T11:00:00.000+00:00",
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/987"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the user |
|
|
the team of which the user is a member |
|
|
the date of this user was last connected |
|
|
the user who created this user account |
|
|
the date of this user account was created |
|
|
the user who last modified this user account |
|
|
the date of this user account was last modified |
|
|
whether the user can delete library entities from the front-end with the Squash TM Premium plugin |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this user |
Delete user
A DELETE
to /users/{ids}
deletes one or several user(s) with the given id(s).
Path parameters
Parameter | Description |
---|---|
|
the list of ids of the users |
HTTP request
DELETE /api/rest/latest/users/169,189 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Get user subscribed teams
A GET
to return all the subscribed teams of the user, either by id or by login.
Get user subscribed teams by id
A GET
to /users/{userId}/teams
returns all the subscribed teams of the user with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
HTTP request
GET /api/rest/latest/users/486/teams HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1120
{
"_embedded" : {
"teams" : [ {
"_type" : "team",
"id" : 567,
"name" : "Team A",
"description" : "<p>black panther</p>",
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/teams/567"
}
}
}, {
"_type" : "team",
"id" : 568,
"name" : "Team B",
"description" : "<p>black widow</p>",
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/teams/568"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/486/teams?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the teams of this user |
|
|
the page size for that query |
|
|
total number of elements |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Get user subscribed teams by login
A GET
to /users/login/{login}/teams
returns all the subscribed teams of the user with the given login.
Path parameters
Parameter | Description |
---|---|
|
the login of the user |
HTTP request
GET /api/rest/latest/users/login/User-1/teams HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1129
{
"_embedded" : {
"teams" : [ {
"_type" : "team",
"id" : 567,
"name" : "Team A",
"description" : "<p>black panther</p>",
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/teams/567"
}
}
}, {
"_type" : "team",
"id" : 568,
"name" : "Team B",
"description" : "<p>black widow</p>",
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/teams/568"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/login/User-1/teams?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the teams of this user |
|
|
the page size for that query |
|
|
total number of elements |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Subscribe to teams
A POST
to subscribe the user to their teams, either by ids or by names.
Subscribe to teams by ids
A POST
to /users/{userId}/teams
with teamIds in request parameters subscribes the user with the given id to these teams.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
HTTP request
POST /api/rest/latest/users/987/teams?teamIds=486,487 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
the list of ids of the teams |
Subscribe to teams by names
A POST
to /users/login/{login}/teams
with teamNames in request parameters subscribes the user with the given login to these teams.
Path parameters
Parameter | Description |
---|---|
|
the login of the user |
HTTP request
POST /api/rest/latest/users/login/User-1/teams HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
teamNames=team-1%2C+team-2
Request parameters
Parameter | Description |
---|---|
|
the list of names of the teams |
Unsubscribe from teams
A DELETE
to unsubscribe the user from their teams, either by ids or by names.
Unsubscribe from teams by ids
A DELETE
to /users/{userId}/teams
with teamIds in request parameters unsubscribes the user with the given id from these teams.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
HTTP request
DELETE /api/rest/latest/users/987/teams?teamIds=486,487 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
the list of ids of the teams |
Unsubscribe from teams by names
A DELETE
to /users/login/{login}/teams
with teamNames in request parameters unsubscribes the user with the given login from these teams.
Path parameters
Parameter | Description |
---|---|
|
the login of the user |
HTTP request
DELETE /api/rest/latest/users/login/User-1/teams?teamNames=team-1%2C+team-2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
the list of names of the teams |
Get user clearances
A GET
to /users/{id}/clearances
returns the clearances grouped by profiles for the user with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
HTTP request
GET /api/rest/latest/users/486/clearances HTTP/1.1
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1615
{
"content" : {
"test_designer" : {
"_type" : "profile",
"id" : 7,
"name" : "TestDesigner",
"type" : "system",
"projects" : [ {
"_type" : "project",
"id" : 367,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj1",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/367"
}
}
}, {
"_type" : "project",
"id" : 368,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj2",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/368"
}
}
} ]
},
"validator" : {
"_type" : "profile",
"id" : 9,
"name" : "Validator",
"type" : "system",
"projects" : [ {
"_type" : "project",
"id" : 369,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj3",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/369"
}
}
} ]
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/486/clearances"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
contains clearances grouped by profiles |
|
|
contains the profile attributes (example of the validator profile) |
|
|
the type of the entity |
|
|
the id of the profile |
|
|
the name of the profile |
|
|
system if the profile is a system profile, custom if the profile is a custom profile |
|
|
the list of projects linked to the profile |
|
|
related links |
Links
Relation | Description |
---|---|
|
the link to this user clearances |
Get user clearances (deprecated)
A GET
to /users/{id}/permissions
returns the clearances grouped by profiles for the user with the given id.
This endpoint is still functional but is deprecated. Please use the more comprehensive /users/{id}/clearances
endpoint instead.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
HTTP request
GET /api/rest/latest/users/486/permissions HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1289
{
"content" : {
"test_designer" : [ {
"_type" : "project",
"id" : 367,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj1",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/367"
}
}
}, {
"_type" : "project",
"id" : 368,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj2",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/368"
}
}
} ],
"validator" : [ {
"_type" : "project",
"id" : 369,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj3",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/369"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/486/permissions"
}
}
}
Links
Relation | Description |
---|---|
|
the link to this user clearances |
Add clearances to user
A POST
to /users/{userId}/clearances/{profileId}/projects/{projectIds}
adds given project ids to the given profile id of the user with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
|
the id of the profile |
|
the ids of the projects |
HTTP request
POST /api/rest/latest/users/486/clearances/9/projects/369 HTTP/1.1
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 684
{
"content" : {
"test_designer" : {
"_type" : "profile",
"id" : 4,
"name" : "TestDesigner",
"type" : "system",
"projects" : [ {
"_type" : "project",
"id" : 369,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj3",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/369"
}
}
} ]
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/486/clearances"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
contains the added clearance |
|
|
contains the profile attributes (example of the test designer profile) |
|
|
the type of the entity |
|
|
the id of the profile |
|
|
the name of the profile |
|
|
system if the profile is a system profile, custom if the profile is a custom profile |
|
|
the list of projects linked to the profile |
|
|
related links |
Links
Relation | Description |
---|---|
|
the link to this user clearances |
Add clearances to user (deprecated - only for system profile)
A POST
to /users/{userId}/permissions/{permissionGroup}
adds system profile to the user with the given id.
The possible {permissionGroup} are test_editor, project_viewer, project_manager, test_runner, test_designer, advanced_tester and validator.
This endpoint is still functional but is deprecated. Please use the more comprehensive /users/{userId}/clearances/{profileId}/projects/{projectIds}
endpoint instead.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
|
the profile |
HTTP request
POST /api/rest/latest/users/486/permissions/test_designer?ids=369 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
the ids of the projects |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 533
{
"content" : {
"test_designer" : [ {
"_type" : "project",
"id" : 369,
"description" : "<p>This project is the main sample project</p>",
"label" : "Main Sample Project",
"name" : "proj3",
"active" : true,
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/369"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/486/permissions"
}
}
}
Links
Relation | Description |
---|---|
|
the link to this user clearances |
Delete clearances for user
A DELETE
to /users/{userId}/clearances/{projectIds}
deletes one or several clearances for the given user and given project ids (separated with comma).
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
|
the ids of the project to remove |
HTTP request
DELETE /api/rest/latest/users/486/clearances/369,370 HTTP/1.1
Accept: application/json
Host: localhost:8080
Delete clearances for user (deprecated)
A DELETE
to /users/{id}/permissions
deletes one or several clearances for the given user (ids of projects separated with comma).
This endpoint is still functional but is deprecated. Please use the more comprehensive /users/{userId}/clearances/{projectIds}
endpoint instead.
Path parameters
Parameter | Description |
---|---|
|
the id of the user |
HTTP request
DELETE /api/rest/latest/users/486/permissions?ids=369 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
the ids of the projects |
Get API tokens for a Test automation server user
A GET
to /users/{id}/tokens
returns the API token list for the given Test automation server user id.
Path parameters
Parameter | Description |
---|---|
|
the id of the Test automation server user |
HTTP request
GET /api/rest/latest/users/4/tokens HTTP/1.1
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1026
{
"_embedded" : {
"api-tokens" : [ {
"id" : 1,
"uuid" : "f8e2f2d8-0fbf-4d29-8003-b729bfe212c8",
"user" : {
"_type" : "user",
"id" : 4
},
"name" : "token 1",
"createdOn" : "2024-06-15T07:48:02.000+00:00",
"createdBy" : "admin",
"expiryDate" : "2025-02-03",
"lastUsage" : "2024-06-28T09:54:27.000+00:00",
"permissions" : "READ"
}, {
"id" : 2,
"uuid" : "9e02ea67-f7ae-4c22-80c5-cb6bd64d1786",
"user" : {
"_type" : "user",
"id" : 4
},
"name" : "token 2",
"createdOn" : "2024-05-02T13:18:14.000+00:00",
"createdBy" : "admin",
"expiryDate" : "2024-12-28",
"lastUsage" : "2024-06-10T16:00:07.000+00:00",
"permissions" : "READ-WRITE"
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/users/4/tokens?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the API tokens of the Test automation server user |
|
|
the page size for that query |
|
|
total number of elements |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Create an API token for a Test automation server user
A POST
to /users/{id}/tokens
creates a new API token for the given Test automation server user id.
Path parameters
Parameter | Description |
---|---|
|
the Test automation server user id |
HTTP request
POST /api/rest/latest/users/4/tokens HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 97
Host: localhost:8080
{
"name" : "token read write",
"permissions" : "READ_WRITE",
"expiry_date" : "2025-05-06"
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the name of the API token (maximum 255 characters) |
|
|
the permissions for the token ('READ' or 'READ_WRITE') |
|
|
the expiry date for the token in the format 'YYYY-MM-DD' (it cannot exceed one year) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1000
{
"id" : 6,
"uuid" : "9e02ea67-f7ae-4c22-80c5-cb6bd64d1786",
"user" : {
"_type" : "user",
"id" : 4,
"first_name" : "",
"last_name" : null,
"login" : null,
"email" : "",
"active" : true,
"group" : null,
"can_delete_from_front" : true,
"teams" : [ ],
"last_connected_on" : null,
"created_by" : "admin",
"created_on" : "2017-07-04T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-05T10:00:00.000+00:00"
},
"name" : "token read write",
"permissions" : "READ_WRITE",
"expiry_date" : "2025-05-06T00:00:00.000+00:00",
"created_on" : "2024-07-02T13:18:14.000+00:00",
"created_by" : "admin",
"last_usage" : null,
"generated_token" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwidXVpZCI6IjBmZmUxODdmLTAxYzctNGViZC05NjY5LWI0ODFlNzEyMGE1ZiIsInBlcm1pc3Npb25zIjoiUkVBRCIsImlhdCI6MTcyMTMwODc4OSwiZXhwIjoxNzUyNTM3NjAwfQ.qWlfn0D4R5-5PXwTpkArmjY2NOjpcE50dzwlaXkNbRu0K8CRS7YO-xsjPegup73nKxYQBQvbYJ_EPnTURRFQng"
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the ID of the API token |
|
|
the Test automation server user who owns the API token |
|
|
the UUID of the API token |
|
|
the name of the API token |
|
|
the date when the API token was created |
|
|
the user who has created the API token |
|
|
the permissions associated with the API token |
|
|
the expiry date of the API token |
|
|
the date when the API token was last used |
|
|
the generated API token that the user should keep secret |
Delete an API token for a Test automation server user
A DELETE
to users/tokens/{tokenId}
deletes the token of a Test automation server user with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the token |
HTTP request
DELETE /api/rest/latest/users/tokens/3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 204 No Content