Search code examples
google-apigoogle-drive-apigoogle-api-clientgoogle-oauth

Google Drive API REST insert permission returning 500 error on node


I am currently creating an app that will insert permission to a folder. This folder is shared to a service account.

The user of my app login using oAuth2. Once logged in, my app will insert permission to the folder. The problem is, I am getting 500 internal error.

enter image description here


Solution

  • Permissions: create Creates a permission for a file or Team Drive.

    POST https://www.googleapis.com/drive/v3/files/fileId/permissions

    with a post body of a Permissions resource

    {
      "kind": "drive#permission",
      "id": string,
      "type": string,
      "emailAddress": string,
      "domain": string,
      "role": string,
      "allowFileDiscovery": boolean,
      "displayName": string,
      "photoLink": string,
      "expirationTime": datetime,
      "teamDrivePermissionDetails": [
        {
          "teamDrivePermissionType": string,
          "role": string,
          "inheritedFrom": string,
          "inherited": boolean
        }
      ],
      "deleted": boolean
    }
    

    You are not sending a full permissions resource.