I am trying to upload file to sharepoint via Postman.I have following settings:
URL:
https://{tenantID}.sharepoint.com/sites/{mySite}/_api/web/GetFolderByServerRelativeUrl('/sites/{mySite}/Shared Documents')/Files/add(url='test.png',overwrite=true)
Headers:
Authorization: Bearer {accessToken}Accept: application/json;odata=verboseContent-Type: application/octet-stream
uploaded file of type .png in binary form of Postman
Response:
"error": {"code": "-2147024891, System.UnauthorizedAccessException","message": {"lang": "en-US","value": "Access denied." } }