I can't believe this is so hard!
So put simply i am trying to upload a document in Sharepoint with some data being passed in the link.
A little more detail: I'm trying to integrate Sharepoint with Salesforce. In Salesforce I have a link to view an objects documents that uses the following to filter on Sharepoint: .../Shared%20Documents/Forms/AllItems.aspx?FilterField1=SalesforceID&FilterValue1=SALESFORCEID
I have then provided another link that allows the user to upload a document using the following: .../_layouts/15/Upload.aspx?List=LISTGUID
I have then made the SalesforceID column mandatory so that when the user finishes the upload they are presented with the EditForm.aspx where they can input the SalesforceID to associate the document to the Salesforce object. This works pretty well but would be a little slicker if the SalesforceID could be populated automatically.
I started with the following .../_layouts/15/Upload.aspx?List=LISTGUID&SalesforceID=SALESFORCEID
Once you've selected the file to upload and hit ok it takes you to the following which shows the field value being passed on but unfortunately does not populate the required field .../Shared%20Documents/Forms/EditForm.aspx?Mode=Upload&CheckInComment=&ID=9718&RootFolder=%2FROOTFOLDER%2FShared%20Documents&SalesforceID=SALESFORCID
So I started looking into editing the Upload.aspx or EditForm.aspx to accommodate this. This doesn't appear to be possible on Sharepoint online though.
So I started looking into creating a custom page. So i'm pretty good at C# and have already written something that can upload and set metadata in Sharepoint but you cannot run server side code on Sharepoint online.
So I have now been looking into doing this via javascript (https://blogs.msdn.microsoft.com/uksharepoint/2013/04/20/uploading-files-using-the-rest-api-and-client-side-techniques/) and am just getting "Access denied. You do not have permission to perform this action or access this resource."
If anyone has had any success with any of the approaches above I would love to know how you managed to get it working. For the amount of time i'm spending on trying to fix this and how much time it's actually going save our users I'm ready to give up.