Unleashing the Power of Square Payment API Integration in Mendix
Integrate your Mendix business application with Square Payment API – a robust payment solution that automates financial transactions for your...
Discover how to seamlessly integrate Mendix applications with Google Drive for efficient file management. This guide provides step-by-step instructions for importing files from Mendix to Google Drive, highlighting key features, setup processes, and best practices for enhancing collaboration and data accessibility.
Configure the credentials in Google.
Generate the access token in Postman.
Upload a file to Google Drive from Mendix.
Step 1: Configure the credentials in Google
Open the following link to see the page, as shown in the picture below.
https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid
2. Click on 'Google APIs Console' as shown in the picture above. You will be redirected to the following page.
3. Go to the 'GoogleLogin' option in the menu bar and it will open the following pop-up page.
5. On the page above, enter the project name and click on the 'Create' button. This will create a new project in the Google Cloud Console.
6. Select the project you created in the Google Cloud Console. You will then be redirected to the page below.
Click on 'Create Credentials' and select 'OAuth Client ID.' Configure the OAuth consent screen by selecting 'External' as the user type, then click on the 'Create' button at the bottom of the page.
In the OAuth consent screen, provide the following app information:
App name and User support email
App domain: http://localhost:8080/
Authorized Domains:
oauth.pstmn.io
mxapps.io
After entering the details, click on the 'Save and Continue' button. I have added the ‘Scopes’, and the page should now look like the image below.
9. After adding the scopes, click on the 'Save and Continue' button.
10. Review the summary in the Summary tab and click on the 'Back to Dashboard' button.
11. In the Library, enable the Google Drive API.12. Go back to the dashboard to find the OAuth 2.0 Client IDs. Download the file from the Actions column and store it securely, as you'll need these credentials later.
Step:2 Generate the access token in Postman
Open Postman and select "New Tab." Enter the following URL:
https://cloudresourcemanager.googleapis.com
Select the ‘Auth’ type as ‘OAuth 2.0’ and configure the settings to get a new access token:
Callback URL for Postman: https://oauth.pstmn.io/v1/callback
Scopes:
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
Use the remaining credentials from the file you downloaded from Google Cloud, and then click on ‘Get New Access Token’.
You will receive a new access token. Click 'Use Access Token' to apply it.
Step 3: Upload a file to Google drive from Mendix
Download the Google Connector OAuth 2.0 module from the Marketplace.
Add a page named GoogleOAuthsettings_overview to the navigation and run the application.
Open the front-end application and click on the GoogleOAuthsettings_overview tab in the menu bar. It will appear as shown in the image below.
Click on the 'NEW' button to open a pop-up page for configuring the data. After entering the details, click on the 'Save' button.
5. Click on 'Generate Token' to receive the 'Access Token' and 'Refresh Token'.
Note: You need to refresh the access token every hour, as it expires hourly.
Download the Google Drive Connector module from the Marketplace.
Add a page named Test_GoogleDrivePage_overview to the navigation and run the application.
Open the front-end application and click on the Test_GoogleDrivePage_overview tab in the menu bar. This will open a new page, as shown in the image below.
Click on 'Create file in drive' to open a pop-up page. Configure the data on this page, then click on the 'Create File' button, as shown in the image below.
After clicking on 'Create File,' you will be redirected to the details page. Review the data and then click on the 'Get as document' option, as shown in the image below.
11. Check your Google Drive account to verify that the file uploaded.
In conclusion, integrating Google Drive file uploads into Mendix applications offers significant advantages including enhanced flexibility, scalability, and accessibility. Leveraging the Google Drive API allows developers to streamline the process of file uploads directly to Google Drive for users, thereby improving collaboration and data management within Mendix applications.
Read More:
To know more about Mendix click on the following link.
Integrate your Mendix business application with Square Payment API – a robust payment solution that automates financial transactions for your...
Discover how to integrate Jira with Mendix to streamline workflows, improve collaboration, and optimize project tracking. A step-by-step guide to...
Discover the benefits of Mendix and ChatGPT integration for AI-driven interactions and exceptional customer service. Follow our step-by-step guide...