I am running an app in Autodesk Platform Services(formerly Forge). For some files it takes more than 60 minutes to get the results, so the upload URL has expired then the upload takes place, ending in a upload failed result. I changed the minutesExpiration on S3UploadURL to 60 but I require more time. I need to feed the output URL to the workItem, so I do not think I can get it later to avoid the expiration of it.
Find below the piece of code where I get the temporary URL with expirationMinutes options set to 60, I create the workItem and I feed the outputURL. Looking forward for some kind person who could help to extend this 60 minutes limit or knows a workaround.
//POST Get temporary Upload URL
var objectsApiInstance3 = new ObjectsApi();
Dictionary<string, object> opts = new Dictionary<string, object>();
opts.Add("minutesExpiration", 60);
var uploadCsvResponse = objectsApiInstance3.getS3UploadURLAsync(urnOutputBucket, urnOutputObjectKey, opts);
dynamic uploadCsv = JsonConvert.DeserializeObject<Dictionary<string, object>>(uploadCsvResponse.Result.ToString());
string uploadUrl = "";
string outputUploadKey = "";
foreach (var e in uploadCsv)
{
if (e.Key == "urls")
{
uploadUrl = e.Value[0];
}
if (e.Key == "uploadKey")
{
outputUploadKey = e.Value;
}
}
//POST Create workItem
var service = new ForgeService(new HttpClient(new ForgeHandler(Microsoft.Extensions.Options.Options.Create(new ForgeConfiguration()
{ ClientId = clientID, ClientSecret = clientSecret }))
{ InnerHandler = new HttpClientHandler() }));
var workItemsApiInstance = new WorkItemsApi(service);
var workItem = new WorkItem()
{
ActivityId = clientID + "." + activity + "+" + alias,
Arguments = new Dictionary<string, IArgument>()
{
{
"rvtFile",
new XrefTreeArgument()
{
PathInZip = fileNames[n],
Url = downloadUrl
}
}, {
"exportChangesSettings",
new XrefTreeArgument()
{
Url = urlDownloadExportChangesSettings
}
}, {
"Result",
new XrefTreeArgument()
{
LocalName = outputFileName,
Verb = Verb.Put,
Url = uploadUrl
}
}
}
};
var workItemResult = await workItemsApiInstance.CreateWorkItemAsync(workItem);
var workItemStatus = await api.GetWorkitemStatusAsync(workItemResult.Content.Id);
It sounds like you use OSS. If so, a better way of doing this is described here: https://aps.autodesk.com/blog/new-feature-support-direct-s3-migration-inputoutput-files-design-automation