Profile
Properties of a profile.
| Name | Type | Description |
|---|---|---|
id |
int | Unique ID of a profile |
name |
string | Unique name of a profile within a user account |
sort_order |
int | Indicates the ascending sort order of the attributes in all responses |
attributes |
Array |
IDs of attributes which belongs to the profile |
Get all profiles (GET /profile)
Details
Returns all profiles of the currently logged-in user. Only profiles are returned to which at least one attribute is assigned to for which the token has a read or write right.
Request parameters
| Name | Type | Description |
|---|---|---|
ignore_rights |
bool, optional | Shows all profiles without hiding "empty" profiles as describe above. The user has to be priveledged for this action |
fields[] |
mixed, optional | Fields to included in the response |
Response
[
{
"id": 10,
"name": "vacation",
"sort_order": 0,
"attributes": []
},
{
"id": 11,
"name": "vacation1",
"sort_order": 0,
"attributes": [
1,
2
]
}
]
Response codes
200Profiles returned204No profiles were found400Invalid field or field values401Authentication failed
Get single profile (GET /profile/{id})
Details
Returns a single profile. Profiles that contain no attribute for which the token has any rights on, cannot be fetched (unless the user is priveleged).
Request parameters
| Name | Type | Description |
|---|---|---|
{id} |
int | The unique ID of the profile |
ignore_rights |
bool, optional | Shows the profile even if it's "empty" as describe above. The user has to be priveledged for this action |
fields[] |
mixed[], opt | Fields to included in the response |
Response
{
"id": 13,
"name": "vacation DE",
"sort_order": 0,
"attributes": [
5,
1
]
}
Response codes
200Profile returned400Invalid ID or fields supplied401Authentication failed404: Profile was not found or doesn't contain at least a single attribute for which the token has a right on
Create profile (POST /profile)
Details
Creates a profile.
Request body
See properties for values, example:
{
"name": "Vacation",
"sort_order": 0
}
Response body
See action get single profile for a response body.
Response codes
201Profile was created400Invalid values for fields supplied401Authentication failed409An profile with the same name already exists404The given profile was not found
Delete profile (DELETE /profile/{id})
Details
Deletes a single profile.
Request parameters
| Name | Type | Description |
|---|---|---|
{id} |
int | The unique ID of the profile |
Response codes
200Profile deleted400Invalid ID supplied401Authentication failed404The profile was not found412The token used to delete the profile has no right on this attribute
Update profile (PUT /profile/{id})
Details
Updates a profile.
Request parameters
| Name | Type | Description |
|---|---|---|
{id} |
int | Unique ID of the profile |
Request body
See properties for values and Create profile for an example.
Response
See action Get single profile for a response body.
Response codes
200Profile updated400Invalid ID supplied401Authentication failed404The profile was not found412The token isn't priveleged
Patch sorting of attributes (PATCH /profile/sort)
Details
Patches the sorting of all provided profiles.
Request body
Only the properties id and sort_order are available for patching the attributes
[
{
"id": 123,
"sort_order": 3
},
{
"id": 124,
"sort_order": 4
}
]