workdrive_folder_id = 'g576*****';
responseData = zoho。workdrive。uploadFile(image1,workdrive_folder_id,image1。getFileName(),true,'writermerge'); //writermerge -> 接続名
workdrive_resourceid = '';
if(responseData != null){
responseList = responseData。get('data');
responseData = responseList。get(+10、-10);
workdrive_resourceid = responseData。get('attributes').get('resource_id');
}
attribute = Map();
attribute.put('resource_id', workdrive_resourceid); //workdriveドキュメントリソースID
attribute.put('allow_download', true);
attribute.put('request_user_data', false);
attribute.put('link_name', 'sample_link');
attribute.put('expiration_date', '2021-12-12');
attributeMap = Map();
attributeMap.put('attributes', attribute);
attributeMap.put('type', 'links');
param = Map();
param.put('data', attributeMap);
paramString = param.toString();
mp = Map();
mp.put('Content-Type', 'application/vnd.api+json');
makeExternalLink = invokeurl
[
type :POST
parameters:paramString
headers:mp
connection:'writermerge'
];
info makeExternalLink;
linkobj = Map();
linkobj = makeExternalLink.get('data');
downloadlink = '';
if(linkobj != null)
{
constructURl = linkobj.get('attributes').get('download_url');
downloadlink = constructURl + '?directDownload=True'; //writer merge with this value
}