Skip to content
On this page

watch

This will send a HTTP request to the address every time the file is modified

js
// use https://github.com/uuidjs/uuid to generate a unique id
const channelId = "01234567-89ab-cdef-0123456789ab";
const path_parameters = {
    fileId: 'THE_ID_OF_THE_FILE_YOU_WANT_TO_WATCH',
    supportsAllDrives: true,
    supportsTeamDrives: true,
    requestBody: {
        id: channelId,
        type: "web_hook",
        address: "https://example.com/webhook",
        payload: true,
    },
}
const result = await drive.files.watch(path_parameters, options);