SharedItems

Introduction

SharedItems are used to share a targeted entity via a never-changing, unique URL.

Each SharedItem has a concrete type which defines which targetables are allowed and which config information must/can be provided.

A SharedItem redirects to a URL defined by the targeted entity and type, when allowed by redirect type and EntityPermissions.

Model Definition

Alias

sharedItem

Relations

Key
Relation
Type
Relation Field(s)

user

Belongs to

user_id

targetable

Targetable

Morph to

targetable_type, targetable_id

entityPermissions

Morph many

Types

Redirect Types

  • none - Do not redirect to the targetable entity URL.

  • redirect - Redirect to the targetable entity URL without granting access.

  • redirectWithGrantToken - Redirect to the targetable entity URL and grant access for the entity by including a GrantToken.

Targetable URL Types

SharedItems support multiple URL types to get a alternate redirect URL from the targetable entity. These targetable URL types can be requested by including them as URL parameter.

  • showFileContent - Redirect to the file content URL of the targetable entity.

    • Supported types: filemanagerFile

  • downloadFileContent - Redirect to the file download URL of the targetable entity.

    • Supported types: filemanagerFile

List

Get a list of all SharedItems.

Definition

GET /api/shared-items

Example Request

Example Response

Show

Show a single SharedItem by uuid.

Definition

GET /api/shared-items/{uuid}

Example Request

Example Response

[Adm.] List

Get a list of all SharedItems the user is allowed to administrate.

Definition

GET /api/administration/shared-items

Example Request

Example Response

[Adm.] Show

Show a single SharedItem the user is allowed to administrate by uuid.

Definition

GET /api/administration/shared-items/{uuid}

Example Request

Example Response

[Adm.] Create

Create a new SharedItem.

Definition

POST /api/administration/shared-items

Request Keys

Key
Type
Default
Description

type *

string

-

The type of the SharedItem.

redirect_type

string

Based on type

The redirect type of the SharedItem.

targetable_type

string

-

The morph type for the targetable relation.

targetable_id

integer, string

-

The morph ID for the targetable relation.

config

array

Based on type

The configuration for the SharedItem. Available values depend on type.

Keys with * are required.

Example Request

Example Response

[Adm.] Update

Update an existing SharedItem by uuid.

Definition

PUT /api/administration/shared-items/{uuid}

Request Keys

Key
Type
Default
Description

redirect_type

string

Based on type

The redirect type of the SharedItem.

config

array

Based on type

The configuration for the SharedItem. Available values depend on type.

Example Request

Example Response

[Adm.] Delete

Delete an existing SharedItem by uuid.

Definition

DELETE /api/administration/shared-items/{uuid}

Example Request

Example Response

Last updated