approvals
Creates, updates, deletes, gets or lists an approvals resource.
Overview
| Name | approvals |
| Type | Resource |
| Id | googleworkspace.drivev3.approvals |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
approvalId | string | The approval ID. |
completeTime | string (google-datetime) | Output only. The time the approval was completed. |
createTime | string (google-datetime) | Output only. The time the approval was created. |
dueTime | string (google-datetime) | The time that the approval is due. |
fileContentChangeBehavior | string | Output only. The behavior of the approval when the file content changes. (FILE_CONTENT_CHANGE_BEHAVIOR_UNSPECIFIED, RESET_APPROVAL, NO_APPROVAL_ACTION) |
initiator | object | The user that requested the approval. (id: User) |
kind | string | This is always drive#approval. |
modifyTime | string (google-datetime) | Output only. The most recent time the approval was modified. |
reviewerResponses | array | The responses made on the approval by reviewers. |
status | string | Output only. The status of the approval at the time this resource was requested. (STATUS_UNSPECIFIED, IN_PROGRESS, APPROVED, CANCELLED, DECLINED) |
targetFileId | string | Target file id of the approval. |
| Name | Datatype | Description |
|---|---|---|
approvalId | string | The approval ID. |
completeTime | string (google-datetime) | Output only. The time the approval was completed. |
createTime | string (google-datetime) | Output only. The time the approval was created. |
dueTime | string (google-datetime) | The time that the approval is due. |
fileContentChangeBehavior | string | Output only. The behavior of the approval when the file content changes. (FILE_CONTENT_CHANGE_BEHAVIOR_UNSPECIFIED, RESET_APPROVAL, NO_APPROVAL_ACTION) |
initiator | object | The user that requested the approval. (id: User) |
kind | string | This is always drive#approval. |
modifyTime | string (google-datetime) | Output only. The most recent time the approval was modified. |
reviewerResponses | array | The responses made on the approval by reviewers. |
status | string | Output only. The status of the approval at the time this resource was requested. (STATUS_UNSPECIFIED, IN_PROGRESS, APPROVED, CANCELLED, DECLINED) |
targetFileId | string | Target file id of the approval. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | fileId, approvalId | Gets an approval by ID. For more information, see Manage approvals. | |
list | select | fileId | pageSize, pageToken | Lists the approvals on a file. For more information, see Manage approvals. |
decline | exec | fileId, approvalId | 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. | |
cancel | exec | fileId, approvalId | Cancels 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. | |
start | exec | fileId | Starts an approval on a file. For more information, see Manage approvals. | |
comment | exec | fileId, approvalId | Comments 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. | |
reassign | exec | fileId, approvalId | Reassigns 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. | |
approve | exec | fileId, approvalId | Approves 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.
| Name | Datatype | Description |
|---|---|---|
approvalId | string | |
fileId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT examples
- get
- list
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
;
Lists the approvals on a file. 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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
Lifecycle Methods
- decline
- cancel
- start
- comment
- reassign
- approve
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 }}"
}'
;
Cancels 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.
EXEC googleworkspace.drivev3.approvals.cancel
@fileId='{{ fileId }}' --required,
@approvalId='{{ approvalId }}' --required
@@json=
'{
"message": "{{ message }}"
}'
;
Starts an approval on a file. For more information, see Manage approvals.
EXEC googleworkspace.drivev3.approvals.start
@fileId='{{ fileId }}' --required
@@json=
'{
"message": "{{ message }}",
"lockFile": {{ lockFile }},
"reviewerEmails": "{{ reviewerEmails }}",
"dueTime": "{{ dueTime }}",
"fileContentChangeBehavior": "{{ fileContentChangeBehavior }}"
}'
;
Comments 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.
EXEC googleworkspace.drivev3.approvals.comment
@fileId='{{ fileId }}' --required,
@approvalId='{{ approvalId }}' --required
@@json=
'{
"message": "{{ message }}"
}'
;
Reassigns 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.
EXEC googleworkspace.drivev3.approvals.reassign
@fileId='{{ fileId }}' --required,
@approvalId='{{ approvalId }}' --required
@@json=
'{
"replaceReviewers": "{{ replaceReviewers }}",
"message": "{{ message }}",
"addReviewers": "{{ addReviewers }}"
}'
;
Approves 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.
EXEC googleworkspace.drivev3.approvals.approve
@fileId='{{ fileId }}' --required,
@approvalId='{{ approvalId }}' --required
@@json=
'{
"message": "{{ message }}"
}'
;