![](../servlet/status-macro/placeholder4666.png?colour=Green&title=Docs%3A+UP+TO+DATE&subtle=true)
![](../servlet/confluence/placeholder/macro59ac.png?definition=e2FuY2hvcjpwb3N0LWNvbGxlY3Rpb259&locale=en_GB&version=2)
POST forms/:form_id/groups
Create a group
METHOD: POST
ENDPOINT: /api/v2/forms/:form_id/groups/
AUTHENTICATED: No
The request body is a JSON representation of the group being created.
Example request
POST https://ushv3.dev/api/v2/forms/1/groups {
"label":"First Group",
"priority": 1
}
|
{
"id": 2,
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1\/groups\/2",
"form": {
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1",
"id": "1"
},
"label": "First Group",
"priority": 1,
"attributes": []
}
|
|
![](../servlet/confluence/placeholder/macroa664.png?definition=e2FuY2hvcjpnZXQtY29sbGVjdGlvbn0&locale=en_GB&version=2)
GET forms/:form_id/groups
Listing all groups
METHOD: GET
ENDPOINT: /api/v2/forms/:form_id/groups/
AUTHENTICATED: No
Query Parameters (Not implemented yet)
Name | Type | Description |
---|
order | Optional | Returned groups will be sorted in this order: ASC or DESC. Default: DESC |
order_by | Optional | Returned groups will be sorted by this field. Default: created |
limit | Optional | Limit number of results returned. Default: 50. Max: 500 |
offset | Optional | groups returned will be offset by this number of results |
Example Request
GET https://ushv3.dev/api/v2/forms/1/groups {
"count": 2,
"results": [{
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1\/groups\/1",
"form": {
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1",
"id": "1"
},
"label": "Dummy Group",
"priority": "1",
"attributes": [{
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}]
}, {
"id": "2",
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1\/groups\/2",
"form": {
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1",
"id": "1"
},
"label": "First Group",
"priority": "1",
"attributes": []
}]
}
|
|
![](../servlet/confluence/placeholder/macroc354.png?definition=e2FuY2hvcjpnZXQtaWR9&locale=en_GB&version=2)
GET forms/:form_id/groups/:id
Get a single group
METHOD: GET
ENDPOINT: /api/v2/forms/:form_id/groups/:id
AUTHENTICATED: Yes
Query Parameters
Name | Type | Description |
---|
id | Required | The numerical id of the group being updated. |
Example Request
GET http://ushv3.dev/api/v2/forms/1/groups/1 {
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1\/groups\/1",
"form": {
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1",
"id": "1"
},
"label": "Dummy Group",
"priority": 1,
"attributes": [{
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}]
}
|
|
![](../servlet/confluence/placeholder/macroe40a.png?definition=e2FuY2hvcjpwdXQtaWR9&locale=en_GB&version=2)
PUT forms/:form_id/groups/:id
Update a group
METHOD: PUT
ENDPOINT: /api/v2/forms/:form_id/groups/:id
AUTHENTICATED: Yes
Query Parameters
Name | Type | Description |
---|
id | Required | The numerical id of the group being updated. |
Example Request
PUT http://ushv3.dev/api/v2/forms/1/groups/1 {
"label":"Dummy Group Updated",
"priority": 1
}
|
{
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1\/groups\/1",
"form": {
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1",
"id": "1"
},
"label": "Dummy Group Updated",
"priority": 1,
"attributes": [{
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}]
}
|
|
![](../servlet/confluence/placeholder/macroc4fc.png?definition=e2FuY2hvcjpkZWxldGUtaWR9&locale=en_GB&version=2)
DELETE forms/:form_id/ groups/:id
Deleting a group
METHOD: DELETE
ENDPOINT: /api/v2/forms/:form_id/groups/:id
AUTHENTICATED: YES
Query Parameters
Name | Type | Description |
---|
id | Required | The numerical id of the group being deleted. |
Example request
DELETE /api/v2/forms/1/groups/2 {
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1\/groups\/1",
"form": {
"url": "http:\/\/ushv3.dev\/api\/v2\/forms\/1",
"id": "1"
},
"label": "Dummy Group Updated",
"priority": "1",
"attributes": [{
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}]
}
|
|
![](../servlet/confluence/placeholder/macrodb87.png?definition=e2FuY2hvcjpwb3N0LWF0dHJpYnV0ZX0&locale=en_GB&version=2)
POST forms/:form_id/groups/:group_id/attributes
Add a new or existing attribute to a group
METHOD: POST
ENDPOINT: /api/v2/forms/:form_id/groups/:id/attributes
AUTHENTICATED: Yes
The request data should be JSON object, containing either the full representation of a new attribute, or the id of an existing attribute.
Create a new attribute and add to the group
Example Request
POST http://ushv3.dev/api/v2/forms/1/groups/1/attributes {
"key":"new_group_attr",
"label":"Full Name",
"type":"varchar",
"input":"text",
"required":true,
"priority":1
}
|
{
"id": 2,
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/2",
"key": "new_group_attr",
"label": "Full Name",
"input": "text",
"type": "varchar",
"required": false,
"default": null,
"unique": false,
"priority": null,
"options": null
}
|
|
Add an existing attribute to the group
Example Request
POST http://ushv3.dev/api/v2/forms/1/groups/1/attributes {
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}
|
|
![](../servlet/confluence/placeholder/macrob2a2.png?definition=e2FuY2hvcjpnZXQtYXR0cmlidXRlc30&locale=en_GB&version=2)
GET forms/:form_id/groups/:group_id/attributes
List all attributes from a group.
METHOD: GET
ENDPOINT: /api/v2/forms/:form_id/groups/:group_id/attributes
AUTHENTICATED: Yes
Query Parameters (Not implemented)
Name | Type | Description |
---|
order | Optional | Returned groups will be sorted in this order: ASC or DESC. Default: DESC |
order_by | Optional | Returned groups will be sorted by this field. Default: created |
limit | Optional | Limit number of results returned. Default: 50. Max: 500 |
offset | Optional | groups returned will be offset by this number of results |
Example Request
GET http://ushv3.dev/api/v2/forms/1/groups/1/attributes {
"count": 2,
"results": [{
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}, {
"id": "2",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/2",
"key": "new_group_attr",
"label": "Full Name",
"input": "text",
"type": "varchar",
"required": false,
"default": null,
"unique": false,
"priority": "99",
"options": null
}]
}
|
|
![](../servlet/confluence/placeholder/macro3334.png?definition=e2FuY2hvcjpnZXQtYXR0cmlidXRlLWlkfQ&locale=en_GB&version=2)
GET forms/:form_id/groups/:group_id/attributes
Find a single attribute in a group.
METHOD: GET
ENDPOINT: /api/v2/forms/:form_id/groups/:group_id/attributes/:id
AUTHENTICATED: Yes
Query Parameters
Name | Type | Description |
---|
id | Required | The numerical id of the group being updated. |
Example Request
GET http://ushv3.dev/api/v2/forms/1/groups/1/attributes/1 {
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}
|
|
![](../servlet/confluence/placeholder/macro36e8.png?definition=e2FuY2hvcjpkZWxldGUtYXR0cmlidXRlLWlkfQ&locale=en_GB&version=2)
DELETE forms/:form_id/groups/:group_id/attributes/:id
Remove an attribute from a group.
METHOD: DELETE
ENDPOINT: /api/v2/forms/:form_id/groups/:group_id/attributes/:id
AUTHENTICATED: Yes
Note: This just removes the attribute from the group, it doesn't delete the attribute entirely.
Query Parameters
Name | Type | Description |
---|
id | Required | The numerical id of the group being updated. |
Example Request
DELETE http://ushv3.dev/api/v2/forms/1/groups/1/attributes/1 {
"id": "1",
"url": "http:\/\/ushv3.dev\/api\/v2\/attributes\/1",
"key": "dummy_varchar",
"label": "Dummy",
"input": "text",
"type": "varchar",
"required": true,
"default": null,
"unique": false,
"priority": "1",
"options": null
}
|
|