Skip to content

Check whether the caller may share a node

GET
/drives/{drive}/nodes/{node}/share/permission/policy/create
curl --request GET \
--url https://work.optidata.cloud/api/drives/1/nodes/300754/share/permission/policy/create \
--header 'Authorization: Bearer <token>'

A permission probe: answers 200 when the caller is allowed to grant access on the node, and 403 when not. Use it to decide whether to show a share button, instead of attempting the grant and handling the failure.

drive
required
integer format: int64

Numeric id of the drive. Read it from GET /drives/config.json.

node
required
integer format: int64

Numeric id of the node (file or folder).

The caller may share the node.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampleallowed
{
"message": "User has permission to create a new share"
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller lacks the permission level the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given drive.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Node] 99999999"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}