-
Notifications
You must be signed in to change notification settings - Fork 46
Share Api
Property | Type | Writable | Description |
---|---|---|---|
id | string | no | The UUID of the share |
created | int | no | Unix timestamp when the share was created |
updated | int | no | Unix timestamp when the share was updated |
expires | int / null | yes | Unix timestamp when the share will expire |
editable | bool | yes | Whether or not the receiving user can edit the password |
shareable | bool | yes | Whether or not the receiving user can share the password again |
updatePending | bool | no | Whether or not data changes for this share are in queue |
password | string | yes | The UUID of the password |
owner | object | yes | Object with the id and the full name of the owner |
receiver | object | yes | Object with the id and the full name of the receiver |
Level | Description |
---|---|
model | Returns the base model |
+password | Fills the password property with the base model of the password |
The property "password" is also processed if necessary.
Property | Type | Description |
---|---|---|
type | string | Object type, the value is "share" |
created | Date | Date when the share was created |
updated | Date | Date when the share was last updated |
expires | Date | Date when the share will expire |
owner.icon | string | Url of the default avatar icon of the owner in 32x32px |
receiver.icon | string | Url of the default avatar icon of the receiver in 32x32px |
- Shares have no revisions
- The value of the
password
attribute is different for the owner and the receiver - The
shareable
will always befalse
for the receiver if resharing is disabled system wide
Action | Url | Method | Description |
---|---|---|---|
list | /api/1.0/share/list |
GET | List all shares with the default detail level |
list | /api/1.0/share/list |
POST | List all shares with the given detail level |
show | /api/1.0/share/show |
POST | Show a share |
find | /api/1.0/share/find |
POST | Find shares matching given criteria |
create | /api/1.0/share/create |
POST | Create a new share |
update | /api/1.0/share/update |
PATCH | Update an existing share |
delete | /api/1.0/share/delete |
DELETE | Delete a share |
partners | /api/1.0/share/partners |
GET | Find users you can share with |
partners | /api/1.0/share/partners |
POST | Find users you can share with by pattern |
This commands returns an array of users that the current user can share with.
Argument | Type | Default | Required | Description |
---|---|---|---|---|
search | string | - | no | Find users containing the search string |
The success status code is 200 Ok
.
The return value is an array with the user id as key and the user display name as value.
The array is at maximum around 512 entries long.
If the autocompletion is disabled by the administrator the result is an empty array
- This command will fail if sharing is disabled
The create action creates a new share with the given attributes.
Argument | Type | Default | Required | Description |
---|---|---|---|---|
password | string | - | yes | The UUID of the password |
receiver | string | - | yes | The user id of the user which the password should be shared with |
type | string | "user" | no | The type of the share |
expires | int / null | null | no | Unix timestamp when the share will expire |
editable | bool | false | no | Whether or not the receiver can edit the password |
shareable | bool | false | no | Whether or not the receiver can share the password |
The success status code is 201 Created
Argument | Type | Description |
---|---|---|
id | string | The UUID of the share |
- This action will fail if the password is hidden or the CSE does not support sharing
- You can not share a password with the same user more than once
- This command will fail if sharing is disabled
The update action changes the properties of an existing share.
Argument | Type | Default | Required | Description |
---|---|---|---|---|
id | string | - | yes | The UUID of the share |
expires | int / null | null | no | Unix timestamp when the share will expire |
editable | bool | false | no | Whether or not the receiver can edit the password |
shareable | bool | false | no | Whether or not the receiver can share the password |
The success status code is 200 Ok
Argument | Type | Description |
---|---|---|
id | string | The UUID of the share |
- You can only edit a share if it is owned by the user
- This command will fail if sharing is disabled
The delete action deletes a share.
Arguments | Type | Default | Required | Description |
---|---|---|---|---|
id | string | - | yes | The id of the share |
The success status code is 200 Ok
Argument | Type | Description |
---|---|---|
id | string | The UUID of the share |
- You can only delete shares owned by the user.
- If you want to delete a share where the current user is the receiver, you need to delete the password instead
- This action still works if sharing has been disabled
The show action lists the properties of a single share.
Argument | Type | Default | Required | Description |
---|---|---|---|---|
id | string | - | yes | The id of the share |
detailLevel | string | "model" | no | The detail level of the returned share object |
The success status code is 200 Ok
The return value is a share object with the given detail level
- This action still works if sharing has been disabled
The list action lists all shares with the user as owner or receiver.
Argument | Type | Default | Required | Description |
---|---|---|---|---|
detailLevel | string | "model" | no | The detail level of the returned share objects |
The success status code is 200 Ok
The return value is a list of share objects with the given detail level
- This action still works if sharing has been disabled
The find action can be used to find all shares matching the given search criteria. Only a specific set of fields is allowed in the criteria. How the criteria array works is explained on the object search page.
Argument | Type | Default | Required | Description |
---|---|---|---|---|
criteria | array | [] | no | The search criteria |
detailLevel | string | "model" | no | The detail level of the returned share objects |
Field | Type | Description |
---|---|---|
created | int | Unix timestamp when the share was created |
updated | int | Unix timestamp when the share was updated |
owner | string | User id of the owner of the share |
receiver | string | User id of the receiver of the share |
expires | int / null | Unix timestamp when the share will expire |
editable | bool | Whether or not the receiver can edit the password |
shareable | bool | Whether or not the receiver can share the password |
The success status code is 200 Ok
The return value is a list of shares objects that match the criteria with the given detail level
- The
owner
andreceiver
fields allow the special value_self
which is replaced with the users id - This action still works if sharing has been disabled