|
|
|
|
- Difference between Drive and gglDrive variables
- Using an access token
GglDriveConnect (Function) In french: GglDriveConnecte Creates a connection to Google Drive.
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"
MyDrive is gglDrive
MyDrive = GglDriveConnect(oOAuth2Param)
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:
| | | Downloads a Google Docs Editors file from Google Drive in a given compatible format. | | Lists Google Docs Editors files (Docs, Sheets, etc.) present on Google Drive. |
- Functions with specific syntax for files in Google Docs Editors:
| | | Copies a single file on a remote drive to another directory on same drive. | | Deletes a file from a remote drive. | | 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 variable | Value 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:
|
Unit examples (WINDEV): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
|
|
Unit examples (WINDEV Mobile): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
|
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|