Sample source to reflect the process to GoogleWorkSpace based on the data of Microsoft365 Lists [All Employee List].
- Currently, it is only applied to the shared drive of GoogleDrive.
- Assuming that the trigger is executed every 5 minutes on the gas side.
npm install @google/clasp -g
npm install -g npm@latest
clasp login
(4) Create a client secret under "New Client Secret" in the "Client Secret" tab under "Certificates and Secrets" in the app you created (remember to note the value at this time. Once you close it or something, it will not be visible.).
(5) Select Microsoft Graph from the "API Permissions" of the created application and add "User.Read" and "Sites.Read.All" from the application permissions.
- .clasp.json
YOUR_SCRIPT_ID
YOUR_ROOT_DIRECTORY - index.js
The following sets out the information found in the Microsoft Entra Management Center.
YOUR_MICROSOFT-ENTRA_CLIENT_ID
YOUR_MICROSOFT-ENTRA_TENANT_ID
YOUR_MICROSOFT-ENTRA_CLIENT_SECRET
Below is a Graph Explorer to see and set up what is actually used in your Micrsoft365.
YOUR_MICROSOFT365_SHAREPOINT_SITE_ID
YOUR_MICROSOFT365_LISTS_LIST_ID
The following should be the column names used in Lists. Note that if the column name is in Japanese, the alphanumeric symbols are used.
USER_EMAIL_ADDRESS
The following is set up as confirmed by GCP.
YOUR_GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY
YOUR_GOOGLE_SERVICE_ACCOUNT_CLIENT_EMAIL
YOUR_GOOGLE_API_KEY
The following sets the shared drive ID. If you want to set more than one, copy and paste "folderList.push('SHARE_DRIVE_FOLDER_ID');" to increase the number.
SHARE_DRIVE_FOLDER_ID
Verify the settings in .clasp.json and adjust the [rootDir] setting to match the local path where the source code is located.
clasp push
-
Postman's MicrosoftGraphAPI collection MicrosoftGraphAPICollection
-
Postman's MicrosoftGraphAPI preferences Fork environment.
-
Microsoft Entra Management Center(旧名 Microsoft Active Directory) https://entra.microsoft.com/#home
-
Graph Explorer https://developer.microsoft.com/en-us/graph/graph-explorer
-
Microsoft Graph Rest API Reference https://learn.microsoft.com/ja-jp/graph/api/overview?view=graph-rest-1.0
-
Google Drive API v3 Reference https://developers.google.com/drive/api/reference/rest/v3