I've been searching high and low for any information on this but I haven't found anything useful so far. I'm relatively new to the podio API and I'm trying to upload/attach a file I create in my program to a specific item in a specific app. I've successfully uploaded the file to the API and I've added it to the specific item's list of files however it doesn't 'stick'/update to have any permanence. At the end of the method I can call getFiles() and the file will be there however the file is not visible on podio and if i call getFiles() any other time it won't be there. Here's my code:
public static void uploadTimeSheet(File timeSheet){
FileAPI fileApi = apiFactory.getAPI(FileAPI.class);
int fileId = fileApi.uploadFile(timeSheet.getName(), timeSheet);
com.podio.file.File timeSheetUploaded = fileApi.getFile(fileId);
List<com.podio.file.File> files = new ArrayList<com.podio.file.File>();
files = userItem.getFiles();
files.add(timeSheetUploaded);
userItem.setFiles(files);
}
userItem is the specific Item I want to upload the file to. I'm by no means an experienced coder but it seems to me that by calling setFiles(files) i only update a local version of the item userItem? If that's the case then how can I update podio's version of userItem with my own? And if i completely barking up the wrong tree where have I gone wrong? I've been searching for methods which update items but they only seems to be for updating fields/field values.
Thanks in advance!
