Skip to main content

approvals

Creates, updates, deletes, gets or lists an approvals resource.

Overview

Nameapprovals
TypeResource
Idgoogleworkspace.drivev3.approvals

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
approvalIdstringThe approval ID.
completeTimestring (google-datetime)Output only. The time the approval was completed.
createTimestring (google-datetime)Output only. The time the approval was created.
dueTimestring (google-datetime)The time that the approval is due.
fileContentChangeBehaviorstringOutput only. The behavior of the approval when the file content changes. (FILE_CONTENT_CHANGE_BEHAVIOR_UNSPECIFIED, RESET_APPROVAL, NO_APPROVAL_ACTION)
initiatorobjectThe user that requested the approval. (id: User)
kindstringThis is always drive#approval.
modifyTimestring (google-datetime)Output only. The most recent time the approval was modified.
reviewerResponsesarrayThe responses made on the approval by reviewers.
statusstringOutput only. The status of the approval at the time this resource was requested. (STATUS_UNSPECIFIED, IN_PROGRESS, APPROVED, CANCELLED, DECLINED)
targetFileIdstringTarget file id of the approval.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfileId, approvalIdGets an approval by ID. For more information, see Manage approvals.
listselectfileIdpageSize, pageTokenLists the approvals on a file. For more information, see Manage approvals.
declineexecfileId, approvalIdDeclines an approval. For more information, see Manage approvals. This is used to update the ReviewerResponse of the requesting user with a Response of DECLINED. This also completes the approval and sets the approval Status to DECLINED.
cancelexecfileId, approvalIdCancels an approval. For more information, see Manage approvals. Updates the approval Status to CANCELLED. This can be called by any user with the writer permission on the file while the approval Status is IN_PROGRESS.
startexecfileIdStarts an approval on a file. For more information, see Manage approvals.
commentexecfileId, approvalIdComments on an approval. For more information, see Manage approvals. This sends a notification to both the initiator and the reviewers. Additionally, a message is also added to the approval activity log.
reassignexecfileId, approvalIdReassigns the reviewers on an approval. For more information, see Manage approvals. Adds or replaces reviewers in the ReviewerResponse of the approval. This can be called by any user with the writer permission on the file while the approval Status is IN_PROGRESS and the Response for the reviewer being reassigned is NO_RESPONSE. A user with the reader permission can only reassign an approval that's assigned to themselves. Removing a reviewer isn't allowed.
approveexecfileId, approvalIdApproves an approval. For more information, see Manage approvals. This is used to update the ReviewerResponse of the requesting user with a Response of APPROVED. If this is the last required reviewer response, this also completes the approval and sets the approval Status to APPROVED.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
approvalIdstring
fileIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets an approval by ID. For more information, see Manage approvals.

SELECT
approvalId,
completeTime,
createTime,
dueTime,
fileContentChangeBehavior,
initiator,
kind,
modifyTime,
reviewerResponses,
status,
targetFileId
FROM googleworkspace.drivev3.approvals
WHERE fileId = '{{ fileId }}' -- required
AND approvalId = '{{ approvalId }}' -- required
;

Lifecycle Methods

Declines an approval. For more information, see Manage approvals. This is used to update the ReviewerResponse of the requesting user with a Response of DECLINED. This also completes the approval and sets the approval Status to DECLINED.

EXEC googleworkspace.drivev3.approvals.decline
@fileId='{{ fileId }}' --required,
@approvalId='{{ approvalId }}' --required
@@json=
'{
"message": "{{ message }}"
}'
;