Task Group Templates
References
Task Group Templates API
POST /api/task-group-templates/
Creates Task Group Template.
Permissions
Requires authentication and task_group_templates.create permission.
Request
- Body parameters
| Key | Type | Notes |
|---|---|---|
| name | str | |
| object_classes | Array | |
| task_templates | Array |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
POST /api/task-group-templates/
{
"name": "Test Task Group Template",
"object_classes": [
1
],
"task_templates": [
1
]
}Validations
- name
- is string
- is required
- is not null
- is not blank
- is unique (case insensitive)
- max length is 100
- description
- is string
- max length is 500
- object_classes
- is required
- is list of Object Classes ids
- is not empty
- task_templates
- is required
- is list of manual type Task Templates ids
- is not empty
Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| description | string | |
| object_classes | Array | |
| task_templates | Array | |
| created_at | date | |
| created_by | user | |
| modified_at | date | |
| modified_by | user | |
| _meta | Object | _meta result |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| permission | Object | |
| labels.object_classes | Array | |
| labels.task_templates | Array |
- Successful status
201 Created - Response body schema
{
"id": 1,
"name": "Test 1",
"description": "Desc for Test 1",
"object_classes": [
1
],
"task_templates": [],
"created_at": "2022-05-17T13:18:49.312474+02:00",
"created_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"modified_at": "2022-05-17T13:18:49.312496+02:00",
"modified_by": null,
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true
},
"labels": {
"object_classes": [
"Object test name"
],
"task_templates": []
}
}
}Errors
| Cause | Response code | Message |
|---|---|---|
| "name" is missing | 400 Bad Request | "name": ["This field is required."] |
| "name" is empty | 400 Bad Request | "name": ["This field may not be blank."] |
| "name" is not unique | 400 Bad Request | "name": ["This field must be unique."] |
| "name" is too long | 400 Bad Request | "name": ["Ensure this field has no more than 100 characters."] |
| "description" is too long | 400 Bad Request | "description": ["Ensure this field has no more than 500 characters."] |
| "object_classes" is missing | 400 Bad Request | "object_classes": ["This field is required."] |
| "object_classes" is empty | 400 Bad Request | "object_classes": ["This list may not be empty."] |
| "object_classes" invalid pk | 400 Bad Request | "object_classes": ["Invalid pk "pk" - object does not exist."] |
| "task_templates" invalid pk | 400 Bad Request | "task_templates": ["Invalid pk "pk" - object does not exist."] |
| "task_templates" is missing | 400 Bad Request | "task_templates": ["This field is required."] |
| "task_templates" is manual | 400 Bad Request | "task_templates": ["Manual task templates can't be used: Name1, Name2."] |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
PATCH /api/task-group-templates/id/
Updates single Task Group Template.
Permissions
Requires authentication and task_group_templates.edit permission.
Allowed parameters
| Key | Type | Notes |
|---|---|---|
| name | str | |
| object_classes | Array | |
| task_templates | Array |
Any parameter not listed above are silently ignored if passed.
Request
- Headers
Request Method: PATCH
Content-Type: application/json
Location: /api/task-group-templates/1/
Authorization: JWT access_token- Sample request body
{
"name": "Test Task Group Template",
"object_classes": [
1
],
"task_templates": []
}Validations
- name
- is string
- is required
- is not null
- is not blank
- is unique (case insensitive)
- max length is 100
- description
- is string
- max length is 500
- object_classes
- is required
- is list of Object Classes ids
- is not empty
- task_templates
- is required
- is list of manual type Task Templates ids
- is not empty
Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| description | string | |
| object_classes | Array | |
| task_templates | Array | |
| created_at | date | |
| created_by | user | |
| modified_at | date | |
| modified_by | user | |
| _meta | Object | _meta result |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| permission | Object | |
| labels.object_classes | Array | |
| labels.task_templates | Array |
- Successful status
200 Ok - Response body schema
{
"id": 1,
"name": "Test Task Group Template",
"description": "Desc for Test 1",
"object_classes": [
1
],
"task_templates": [],
"created_at": "2022-05-17T13:18:49.312474+02:00",
"created_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"modified_at": "2022-05-17T13:18:49.312496+02:00",
"modified_by": null,
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true
},
"labels": {
"object_classes": [
"Object test name"
],
"task_templates": []
}
}
}Errors
| Cause | Response code | Message |
|---|---|---|
| "name" is missing | 400 Bad Request | "name": ["This field is required."] |
| "name" is empty | 400 Bad Request | "name": ["This field may not be blank."] |
| "name" is not unique | 400 Bad Request | "name": ["This field must be unique."] |
| "name" is too long | 400 Bad Request | "name": ["Ensure this field has no more than 100 characters."] |
| "description" is too long | 400 Bad Request | "description": ["Ensure this field has no more than 500 characters."] |
| "object_classes" is missing | 400 Bad Request | "object_classes": ["This field is required."] |
| "object_classes" is empty | 400 Bad Request | "object_classes": ["This list may not be empty."] |
| "object_classes" invalid pk | 400 Bad Request | "object_classes": ["Invalid pk "pk" - object does not exist."] |
| "task_templates" invalid pk | 400 Bad Request | "task_templates": ["Invalid pk "pk" - object does not exist."] |
| "task_templates" is missing | 400 Bad Request | "task_templates": ["This field is required."] |
| "task_templates" is manual | 400 Bad Request | "task_templates": ["Manual task templates can't be used: Name1, Name2."] |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
DELETE /api/object-classes/object_class_id/
Remove a Task Group Template with checking if no used anywhere.
Permissions
Requires authentication and task_group_templates.delete permission.
Request example
- Headers
Request Method: DELETE
Location: /api/task-group-templates/1/
Authorization: JWT access_tokenResponse example
- Status
204 No Content - Body
Errors
| Error | Response code | Message |
|---|---|---|
| Task Group Template in use | 400 Forbidden | "detail": "Task Group Template is in use by Sequences." |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Task template does not exist | 404 Forbidden | "detail": "Not found" |
GET /api/task-group-templates/
List Task group templates based on query parameters and caller permissions.
Permissions
Requires authentication and task_group_templates.list permission.
Request
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
GET /api/task-group-templates/Response
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of forms visible to the user (based on permissions). |
| filtered_count | int | Number of forms visible to the user (based on permissions) with filters applied. |
| next | URL / null | Next page URL (null if there is no next page) |
| previous | URL / null | Previous page URL (null if there is no previous page) |
| results | Array | Described in the next table. |
Response results array
| Key | Type | Notes |
|---|---|---|
| id | id | |
| name | string | |
| description | string | |
| object_classes | Array | |
| num_of_task_templates | int | |
| created_at | datetime | |
| created_by | user | |
| modified_at | datetime | |
| modified_by | user | |
| _meta | Object | _meta result |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| permission | Object | Object describing permissions. |
Response example
- Status
200 OK - Body
{
"limit": 100,
"offset": 0,
"filtered_count": 2,
"total_count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "TG 1",
"description": "Desc for task group 1",
"object_classes": [
"OC 1"
],
"num_of_task_templates": 0,
"created_at": "2022-05-17T13:18:49.312474+02:00",
"created_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"modified_at": "2022-10-11T11:54:17.541591+02:00",
"modified_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true
}
}
}
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| id | {build}/api/tasks/?ordering=id | Ascending |
| id | {build}/api/tasks/?ordering=-id | Descending (-) |
| name | {build}/api/tasks/?ordering=name | Ascending |
| name | {build}/api/tasks/?ordering=-name | Descending (-) |
| num_of_task_templates | {build}/api/tasks/?ordering=-num_of_task_templates | Ascending (-) |
| num_of_task_templates | {build}/api/tasks/?ordering=-num_of_task_templates | Descending (-) |
| created_at | {build}/api/tasks/?ordering=created_at | Ascending |
| created_at | {build}/api/tasks/?ordering=-created_at | Descending (-) |
| modified_at | {build}/api/tasks/?ordering=modified_at | Ascending |
| modified_at | {build}/api/tasks/?ordering=-modified_at | Descending (-) |
Filtering
For the full description of standard predicates see ALX API standards - Developers guide.
| Parameter | Predicates | Example |
|---|---|---|
| id | standard pk | {build}/api/tasks/?id=1 |
| name | standard string | {build}/api/tasks/?name__icontains=foobar |
| created_at | standard datetime | {build}/api/tasks/?created_at__gte=2022-01-01 |
| created_by | standard set | {build}/api/tasks/?created_by__in=123,234,345 |
| modified_at | standard datetime | {build}/api/tasks/?modified_at__range=2022-01-01,2022-01-31 |
| modified_by | standard set | {build}/api/tasks/?modified_by=123 |
GET /api/task-group-templates/task_group_templates_id/
Permissions
Requires authentication and task_group_templates.view permission.
Request
- URL parameters
| Key | Type | Notes |
|---|---|---|
| task_group_templates_id | id |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
GET /api/task-group-templates/`task_group_templates_id`/Response
| Key | Type | Notes |
|---|---|---|
| id | uuid | |
| name | string | |
| description | string | |
| object_classes | Array | |
| task_templates | Array | |
| created_at | date | |
| created_by | user | |
| modified_at | date | |
| modified_by | user | |
| _meta | Object | _meta result |
Response _meta object
| Key | Type | Notes |
|---|---|---|
| permission | Object | |
| labels.object_classes | Array | |
| labels.task_templates | Array |
Response example
- Status
200 OK - Body
{
"id": 1,
"name": "Test 1",
"description": "Desc for Test 1",
"object_classes": [
1
],
"task_templates": [],
"created_at": "2022-05-17T13:18:49.312474+02:00",
"created_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"modified_at": "2022-05-17T13:18:49.312496+02:00",
"modified_by": {
"id": 2,
"first_name": "John",
"last_name": "Kowalsky",
"username": "John.Kowalsky@autologyx.com",
"company_name": "",
"is_deleted": false
},
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true
},
"labels": {
"object_classes": [
"Object test name"
],
"task_templates": []
}
}
}Sorting
Not supported
Filtering
Not supported
Errors
| Error | Response code | Message |
|---|---|---|
A non-existent task_group_templates_id was given | 404 Not Found | "detail": "Not found." |
| Requesting user is authorized but without view perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Requesting user is not authenticated | 401 Unauthorized | "detail": "Authentication credentials were not provided." |
GET /api/task-group-templates/autocomplete/
List of Task Group Templates based on query parameters for autocomplete widgets.
Permissions
Requires authentication and task_group_templates.list permission.
Request example
- Headers
Request Method: GET
Location: /api/task-group-templates/autocomplete/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of forms visible to the user (based on permissions). |
| filtered_count | int | Number of forms visible to the user (based on permissions) with filters applied. |
| next | URL / null | Next page URL (null if there is no next page) |
| previous | URL / null | Previous page URL (null if there is no previous page) |
| results | Array | Described in the next table. |
Response results array
| Key | Type | Notes |
|---|---|---|
| value | int | Task Group Template ID |
| text | str | Task Group Template name |
Response example
- Status
200 OK - Body
{
"limit": 100,
"offset": 0,
"filtered_count": 1,
"total_count": 20,
"next": null,
"previous": null,
"results": [
{
"value": 12,
"tesst": "Some name"
}
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| name | {build}/api/task-group-templates/?ordering=name | Ascending |
| name | {build}/api/task-group-templates/?ordering=-name | Descending (-) |
| text | {build}/api/task-group-templates/?ordering=text | Ascending |
| text | {build}/api/task-group-templates/?ordering=-text | Descending (-) |
Filtering
For the full description of standard predicates see ALX API standards - Developers guide.
| Parameter | Predicates | Example | Values |
|---|---|---|---|
| text | standard string | {build}/api/task-group-templates/?text__icontains=template |
Errors
| Error | Response code | Message |
|---|---|---|
| Wrong ordering value | 400 Bad Request | "ordering": ["Select a valid choice. {value} is not one of the available choices."] |
GET /api/task-group-templates/id/usage/
Request example
- Headers
Request Method: GET
Location: /api/task-group-templates/1/usage/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| num_of_sequences | int | |
| sequences | array |
Response sequences array
| Key | Type | Notes |
|---|---|---|
| id | int | Sequence id |
| name | str | Name of sequence |
Response example
- Status
200 OK - Body
{
"num_of_sequences": 1,
"sequences": [
{
"id": 3,
"name": "Sample sequence"
}
]
}Errors
| Error | Response code | Message |
|---|---|---|
id is invalid | 404 Bad Request | 'detail': "Not found." |
| Unauthorized API call | 403 Bad Request | 'detail': "You do not have permission to perform this action." |
OPTIONS /api/task-group-templates/
Permissions
Requires authentication only.
Request
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
OPTIONS /api/task-group-templates/Response
- Successful status
200 OK - Response body:
{
"list": {
"columns": [
{
"alias": "id",
"type": "int",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "name",
"type": "string",
"predicates": [
"exact",
"iexact",
"contains",
"icontains",
"startswith",
"istartswith",
"endswith",
"iendswith"
],
"sort_ok": true
},
{
"alias": "description",
"type": "string",
"predicates": [],
"sort_ok": false
},
{
"alias": "object_classes",
"type": "set",
"predicates": [
"containsall",
"containssome"
],
"sort_ok": false,
"autocomplete": "/api/object-classes/autocomplete/?text__icontains="
},
{
"alias": "num_of_task_templates",
"type": "int",
"predicates": [],
"sort_ok": true
},
{
"alias": "created_at",
"type": "datetime",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "created_by",
"type": "user",
"predicates": [
"exact",
"in"
],
"sort_ok": false,
"autocomplete": "/api/users/autocomplete/?text__icontains="
},
{
"alias": "modified_at",
"type": "datetime",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "modified_by",
"type": "user",
"predicates": [
"exact",
"in"
],
"sort_ok": false,
"autocomplete": "/api/users/autocomplete/?text__icontains="
}
]
},
"details": {
"schema": [
{
"alias": "name",
"type": "string",
"required": true,
"validators": [
{
"type": "max_length",
"length": 100
},
{
"type": "min_length",
"length": 1
}
]
},
{
"alias": "description",
"type": "string",
"required": false,
"validators": [
{
"type": "max_length",
"length": 500
},
{
"type": "min_length",
"length": 0
}
]
},
{
"alias": "object_classes",
"type": "set",
"required": true,
"autocomplete": "/api/object-classes/autocomplete/?text__icontains="
},
{
"alias": "task_templates",
"type": "set",
"required": false,
"autocomplete": "/api/task-templates/autocomplete/?creation=automatic&text__icontains="
}
]
},
"restrictions": {
"limit_items": 10000
}
}