ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 2024 feature!
Help / WLanguage / WLanguage functions / Communication / Drive functions
  • Difference between Drive and gglDrive variables
  • Using an access token
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Creates a connection to Google Drive.
Example
// Authenticating to Google Drive using the OAuth 2.0 protocol
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"
 
MyDrive is gglDrive
MyDrive = GglDriveConnect(oOAuth2Param)
// Authenticating to Google Drive using a token (refresh token)
oOAuth2Param is OAuth2Parameters
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"

oOAuth2Token is AuthToken
oOAuth2Token = AuthIdentify(oOAuth2Param)
 
MyDrive is gglDrive
MyDrive = GglDriveConnect(oOAuth2Token)
Syntax

Authenticating to Google Drive using the OAuth 2.0 protocol Hide the details

<Result> = GglDriveConnect(<Authentication parameters>)
<Result>: Drive or gglDrive variable
gglDrive or Drive variable that contains all the Google Drive connection information.
If an error occurs, the ErrorOccurred variable is set to True and an invalid variable is returned.
<Authentication parameters>: OAuth2Parameters variable
Name of the OAuth2Parameters variable that contains the authentication parameters:
  • The ClientID and ClientSecret properties must be specified.
  • The RedirectionURL property can be specified. By default, this property is set to "http://localhost:3400/".

Authenticating to Google Drive using a token (refresh token) Hide the details

<Result> = GglDriveConnect(<Authentication parameters>)
<Result>: Drive or gglDrive variable
gglDrive or Drive variable that contains all the Google Drive connection information.
If an error occurs, the ErrorOccurred variable is set to True and an invalid variable is returned.
<Authentication parameters>: AuthToken variable
Name of the AuthToken variable that contains the authentication parameters.
Remarks

Difference between Drive and gglDrive variables

The GglDriveConnect function can use both gglDrive and Drive variables.
  • Variables of type Drive will allow you to use the same code, regardless of the storage service used.
  • Variables of type gglDrive will only work with Google Drive. In this case, you will be able to manipulate files in Google Docs Editors using a variable of type GglFile. Some specific functions and syntaxes allow you to manipulate this type of file:
    • Specific functions:
      New in version 2024
      DriveDownloadGglFile
      Downloads a Google Docs Editors file from Google Drive in a given compatible format.
      New in version 2024
      DriveListFileGgl
      Lists Google Docs Editors files (Docs, Sheets, etc.) present on Google Drive.
    • Functions with specific syntax for files in Google Docs Editors:
      New in version 2024
      DriveCopyFile
      Copies a single file on a remote drive to another directory on same drive.
      New in version 2024
      DriveDeleteFile
      Deletes a file from a remote drive.
      New in version 2024
      DriveMoveFile
      Moves a file on a remote drive from one directory to another.

Using an access token

It is recommended to to pass a token with a refresh token so that users do not have to log in each time the application is launched. If necessary, the token will be automatically updated.
Information needed to connect to a drive using an existing token:
Properties of the OAuth2Parameters variableValue used by the GglDriveConnect function
AuthURL"https://accounts.google.com/o/oauth2/v2/auth"
TokenURL"https://oauth2.googleapis.com/token"
Scope"https://www.googleapis.com/auth/drive"
RedirectionURL (Editable)"http://localhost:3400/"
Related Examples:
Drive functions Unit examples (WINDEV): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
Drive functions Unit examples (WINDEV Mobile): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
Business / UI classification: Business Logic
Component: wd290ggl.dll
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/29/2024

Send a report | Local help