Forum Discussion

ptremblay1515's avatar
ptremblay1515
Copper Contributor
Jun 06, 2022

On-premise sharepoint API upload pdf error

Hello, I'm trying to upload a PDF on the on-premise sharepoint 2016 through the API with Postman. Here is my setup.

 

URL: https://test.com/_api/Web/GetFolderByServerRelativeUrl('/somefolder/Shared%20Documents')/Files/Add(url='TestPdf.pdf', overwrite=true)

Authentication: NTLM domain username and password.

Headers: 

Body:

Error:

Here's a couple of question

1. Can I use NTLM to upload a file or do I have to setup sharepoint to use bearer token authentication?

2.  Why I'm I getting this error? Is it because it can't find the folder? I was able to make a GET API call to that folder to get the detailed information and it worked.

 

I used to get "Access Denied" but we fixed that issue by giving the user the correct permissions.

 

I would appreciate any help!

Patrick

 

 

 

Resources