Skip to content

Count the approvals waiting on the caller

GET
/drives/{drive}/approvals/{status}/count
curl --request GET \
--url https://work.optidata.cloud/api/drives/1/approvals/pending/count \
--header 'Authorization: Bearer <token>'

How many approvals addressed to the calling user are in the given state. Approvals on trashed files are not counted. An unknown status returns 404.

drive
required
integer format: int64

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

status
required
string
Allowed values: pending approved rejected

Which approvals to count.

The count.

Media typeapplication/json
object
count
required
integer
Examples
Examplepending
{
"count": 4
}

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 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."
}