bvstone

GreenTools for Microsoft Apps (G4MS) Updated to Allow Downloads, Deletes, and Sharing of Files

Posted:

GreenTools for Microsoft Apps (G4MS) Updated to Allow Downloads, Deletes, and Sharing of Files

GreenTools for Microsoft Apps (G4MS) has been updated to v7.30 which includes new OneDrive functionality.  This update allows you to delete, download, create sharing links, and send sharing invitations for items in your OneDrive.

The following functions are now included in the F.G4MSOD (One Drive) service program:

  • #g4msod_getItemID() - Retrieve the unique ID for an item on the drive.
  • #g4msod_delteItem() - Delete (move to recycle) an item from the drive.
  • #g4msod_downloadItem() - Download an item from the drive.
  • #g4msod_getShareableLink() - Get a shareable link for a drive item.
  • #g4msod_removePermissions() - Remove permissions granted by the get shareable link function.
  • #g4msod_addRecipient() - Add recipient to list of people who will receive a sharing invitation from the following function.
  •  #g4msod_sendItemInvite() - Send a sharing invite to a list of recipients.

Some examples are as follows:

H DFTACTGRP(*NO) ACTGRP('G4MS') BNDDIR('BVSTOOLS')                         
 ****************************************************************          
 * Imports                                                                 
 ****************************************************************          
 /COPY QCOPYSRC,P.G4MSOD                                                   
 ****************************************************************          
D CRLF            C                   CONST(X'0D25')                       
 *                                                                         
D rc              S             10i 0                                      
D itemID          S            256                                         
D errorMsg        S            256  
D shareLink       S          65535    Varying 
D shareID         S          65535    Varying                                        

 /free

  // Get an item ID
  rc = #g4msod_setValue('id':'bvstone@bvstools.com');    
  rc = #g4msod_setValue('path':'/Attachments/myfile.pdf');                      
  itemID = #g4msod_getItemID(errorMsg);                           

  // Delete an item by name
  rc = #g4msod_setValue('id':'bvstone@bvstools.com');    
  rc = #g4msod_setValue('path':'/Attachments/myfile.pdf');     
  rc = #g4msod_deleteItem(errorMsg); 
                                   
  // Delete an item by ID
  rc = #g4msod_setValue('id':'bvstone@bvstools.com');    
  rc = #g4msod_setValue('item_id':itemID);     
  rc = #g4msod_deleteItem(errorMsg); 

  // Download an item by name
  rc = #g4msod_setValue('id':'bvstone@bvstools.com');           
  rc = #g4msod_setValue('path':'/Attachments/myfile.pdf');            
  rc = #g4msod_setValue('download_to_filename':'/tmp/myfile.pdf');    
  rc = #g4msod_downloadItem(errorMsg);   

  // Get a link to share an item
  rc = #g4msod_setValue('id':'bvstone@bvstools.com');            
  rc = #g4msod_setValue('path':'/Attachments/myfile.pdf');                            
  rc = #g4msod_setValue('link_type':'edit');                                 
  rc = #g4msod_setValue('link_scope':'anonymous');                           
  rc = #g4msod_getShareableLink(shareLink:shareID:errorMsg);  
               
  // Remove the permissions from the created link                                                                           
  rc = #g4msod_setValue('id':'bvstone@bvstools.com');            
  rc = #g4msod_setValue('path':'/Attachments/myfile.pdf');                            
  rc = #g4msod_setValue('permission_id':shareID);                            
  rc = #g4msod_removePermissions(errorMsg);                                  
                                   
  // Send a sharing invite to a group of email addresses
  rc = #g4msod_setValue('id':'bvstone@bvstools.com');             
  rc = #g4msod_setValue('path':'/Attachments/myfile.pdf');                             
  rc = #g4msod_setValue('message':'Here is the file!');  
  // Add recipients... up to 200 allowed                     
  rc = #g4msod_addRecipient('jim@yahoo.com');                             
  rc = #g4msod_addRecipient('mary@yahoo.com');                             
  rc = #g4msod_setValue('send_invite':'*YES');                                
  rc = #g4msod_setValue('require_signon':'*YES');                             
  rc = #g4msod_setValue('roles':'read');                                      
  rc = #g4msod_sendItemInvite(errorMsg);                                      


One issue I found (probably a bug on Microsoft's side) is when you are sending a sharing invite and specify require_signon as *NO, the message you send with the invite defaults to one of Microsoft's default messages.  I have opened a ticket with Microsoft on this issue.

Documentation can be found at in the G4MS section of our online documentation.


Last edited 12/17/2021 at 10:04:25



Latest Posts:

MAILTOOL Now Allows Email Redirection for Development and Testing MAILTOOL Now Allows Email Redirection for Development and Testing
Posted by May 27, 2023
BVSTools >> BVSTools Announcements >> eMail Tool (MAILTOOL) Specific Announcements
GreenTools for Microsoft Apps (G4MS) Now Supports Footers When Sending Email GreenTools for Microsoft Apps (G4MS) Now Supports Footers When Sending Email
Posted by March 29, 2023
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
QuickBooks Online - Subtotals and Discounts Frustration QuickBooks Online - Subtotals and Discounts Frustration
Posted by March 16, 2023
QuickBooks >> QuickBooks Online
Making the Switch From QuickBooks Desktop to QuickBooks Online - No Picnic Making the Switch From QuickBooks Desktop to QuickBooks Online - No Picnic
Posted by March 16, 2023
QuickBooks >> QuickBooks Online
BVSTools Software Verified on V7R5 and Power10 BVSTools Software Verified on V7R5 and Power10
Posted by December 9, 2022
BVSTools >> BVSTools Announcements
Microsoft Office 365 Servers and Random Errors Issue Microsoft Office 365 Servers and Random Errors Issue
Posted by November 14, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Sending/Resending Emails Using a MIME File with MAILTOOL Sending/Resending Emails Using a MIME File with MAILTOOL
Posted by November 8, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Sending an HTML Email on Your IBM i Using MAILTOOL Sending an HTML Email on Your IBM i Using MAILTOOL
Posted by November 1, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Transferring License Keys from One System to Another Transferring License Keys from One System to Another
Posted by October 31, 2022
BVSTools >> BVSTools Software Discussion
Calculating the Size of a File Before Base64 Encoding Calculating the Size of a File Before Base64 Encoding
Posted by August 13, 2022
Programming >> RPG Programming
GreenTools for Microsoft Apps (G4MS) v9.12 Now Includes Function to Send Emails using MIME File GreenTools for Microsoft Apps (G4MS) v9.12 Now Includes Function to Send Emails using MIME File
Posted by August 11, 2022
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
GreenTools for Google Apps (G4G) v15.20 Now Supports Shortcuts GreenTools for Google Apps (G4G) v15.20 Now Supports Shortcuts
Posted by August 6, 2022
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
GreenTools for Microsoft Apps (G4MS) Groups Admin Authority Instructions GreenTools for Microsoft Apps (G4MS) Groups Admin Authority Instructions
Posted by July 26, 2022
BVSTools >> BVSTools Software Discussion >> GreenTools for Microsoft Apps (G4MS) Specific Discussion
GreenTools for Microsoft Apps (G4MS) v9.10 Now Includes OneDrive Functions that Work With Groups/Shared Drives GreenTools for Microsoft Apps (G4MS) v9.10 Now Includes OneDrive Functions that Work With Groups/Shared Drives
Posted by July 19, 2022
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
GreenTools for Google Apps (G4G) v15.10 Now Includes Drive Functions that Work With Shared Drives GreenTools for Google Apps (G4G) v15.10 Now Includes Drive Functions that Work With Shared Drives
Posted by July 15, 2022
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements

Reply




Copyright 1983-2020 BVSTools
GreenBoard(v3) Powered by the eRPG SDK, MAILTOOL Plus!, GreenTools for Google Apps, jQuery, jQuery UI, BlockUI, CKEditor and running on the IBM i (AKA AS/400, iSeries, System i).