I am trying to automate file uploads to SharePoint Online. Problem is I keep getting 401 unauthorized error when trying to upload the files. I created a script to retrieve the token as suggested in curl request to Microsoft Sharepoint API?, but uploads are still failing, even though I do get a positive response when running curl -i -H "Authorization: Bearer $(./get_access_token.sh)" -H "Accept: application/json;odata=verbose" -s "https://YourTenant.sharepoint.com/_api/web"
. I have afeeling that I am just malforming my curl command. Any suggestion on command format to be using?
Asked
Active
Viewed 1,336 times
0

laurencew
- 33
- 5