GreenTools for Microsoft Apps (G4MS) v9.10 now includes the G4MSID (OneDrive) addon v7.00. The main changes to this version is that you now can specify a group/shared drive name or group/shared drive id when performing most OneDrive functions.
Leaving the Group ID and Group Name functions blank will default to using your personal local OneDrive.
Examples:
Upload to root of shared drive:
G4MSUPLOAD ID(bvstone@xxxxxx.com) STMF('/tmp/myfile.pdf') GROUP('My Shared Group')
Upload to folder of shared drive:
G4MSUPLOAD ID(bvstone@xxxxx.com) STMF('/tmp/test.pdf') TOFLR('/temp') GROUP('My Shared Group')
The Source Physical File QRPGLESRC in the G4MS library also includes a few more sample programs to show how to use the ILE functions to retrieve Drive IDs, Folder IDs and File IDs from both your local OneDrive Drive and Shared Drives.
H DFTACTGRP(*NO) ACTGRP('G4MS') BNDDIR('G4MS')
****************************************************************
/copy qcopysrc,p.g4ms
****************************************************************
D id S 256
D errorMsg S 256
D rc S 10i 0
D groupID S 256
D itemID S 256
****************************************************************
id = 'bvstone@bvstools.xxxxxxx.com';
// get id of group
g4ms_setValue('id':id);
g4ms_setValue('group_name':'My Shared Files');
groupID = g4ms_getGroupID(errorMsg);
// get id of a folder in a group
rc = g4msod_setValue('id':id);
g4ms_setValue('group_name':'My Shared Files'); rc =
g4msod_setValue('path':'/Attachments');
itemID = g4msod_getItemID(errorMsg);
*INLR = *ON;
As you can see, the g4ms_setValue() function is used to set the group name. Normally this would be g4msod_setValue(), but because groups can cover the entire Office 365 environment we made it more global so in the future if we need to use Groups with other addons that it's already set up.
As always, feel free to contact us with any questions.