I can't create a permission to my file using drive api

19 Views Asked by At

I'm trying to grant permissions to my spreadsheet to some domain using the google drive api. I am using the googleapi npm package.

I'm constantly getting "undefined" response. Is there anything wrong about my request payload?

      type: 'domain',
      role: 'reader',
      email: targetDomain,
    };

try {
      const permission = await this.drive.permissions.create(
          {
            fileId: fileId,
            requestBody: permissionDetails,
          },
          {
            responseType: 'stream'
          })    } catch (e) {
      throw new Error(`Failed to grant permissions. Original error message: ${e.message}`)
    }```

response is just "undefined".
0

There are 0 best solutions below