I am new to Sharepoint and REST APIs and am currently having an issue uploading a file using REST API. I am getting error System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied."}}}|403
when uploading a file.
I am using OAuth and have the tenant ID, client id, and client secret. I have no issue getting the client credentials. But when calling: https://[tenant].sharepoint.com/sites/[site]/_api/web/GetFolderByServerRelativeUrl('[folder dir]')/Files/add(url='test_file.txt',overwrite=true)
then I get the 403 error as response.
Here are my HTTP Headers:
"Authorization": "Bearer" + access token
"Accept": "application/json;odata=verbose"
"Content-Length": *length of file*
Is this an add-in permission issue or am I missing a header? Thanks in advance for your help.