"The remote server returned an error: (404) Not Found" error while download file

  • 1
  • Problem
  • Updated 8 months ago
Hi,

I have tried to download file using ShareFIle API from path “*****/Documents/Test.pdf”. But API throws an error:

 "{"code":"NotFound","message":{"lang":"en-US","value":"Item: Path element 'Documents' not found."},"reason":"NotFound"}The remote server returned an error: (404) Not Found."


The ‘Documents’ folder exists in ShareFile and I am able to download the same file in next attempt. Could you please help me on this issue? 

Thanks,
Niyas
Photo of Muhammed Niyas

Muhammed Niyas

  • 30 Posts
  • 2 Reply Likes

Posted 10 months ago

  • 1
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Niyas,

Where is the folder located? If it's under your "Personal Folder", you have to include the "Personal Folders" name in the path, or use your home folder Id like this:
 Items(<homeId>)/ByPath?path=Documents/Test.pdf

If the folder is under the Shared Folders, it should be working as expected, let me know if that's the case and we can look further.

Thanks,
Eli
Photo of Muhammed Niyas

Muhammed Niyas

  • 30 Posts
  • 2 Reply Likes
Eli,

Folder is located under Shared Folder. 

Thanks,
Niyas
Photo of Muhammed Niyas

Muhammed Niyas

  • 30 Posts
  • 2 Reply Likes
Eli,

Earlier we have directly call the request /sf/v3/Items/ByPath?$expand=Children&path=/TEST/Documents/Test.pdf . In this case API throws an 404 error '"Item: Path element 'Documents' not found.'.


Now we first try /sf/v3/Items/ByPath?$expand=Children&path=/TEST , then we fetch the children from the response, If the children contains 'Documents' folder, then we will proceed with next level like /sf/v3/Items/ByPath?$expand=Children&path=/TEST/Documents .

The response will contains the 'Documents' folder. After the recursive folder checking, we will try the full URL /sf/v3/Items/ByPath?$expand=Children&path=/TEST/Documents/Test.pdf. Sometimes it will throws the same 404 error.

Thanks,
Niyas
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Muhammed,

Apologies for the delay in getting back to you. We've looked at this and are not able to reproduce it locally, so we'll need a bit more help in investigating. We have two possible solutions to try:

1. If you are ok with it, you can create a test user and add it to that folder structure so that we can reproduce the behavior on your account and trace some requests
2. If giving a ShareFile Engineer access to the folder is not possible, we could join a screenshare where we would provide a script that would run several diagnostic api calls using your credentials, and we could use that to investigate.

Let me know which of those would work and we can go from there. Thank you for helping us figure this one out.

Best,
Eli
(Edited)
Photo of Muhammed Niyas

Muhammed Niyas

  • 30 Posts
  • 2 Reply Likes
Eli,

We can try the second method. The best time for the screen share will be between  9:00 AM and 11:00 AM EDT (between Monday and Friday). 

Let us know the date and time, so that we can schedule a session. 

Thanks,
Niyas
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Muhammed,

How would Wednesday April 11th at 9:30 work?

Eli
Photo of Muhammed Niyas

Muhammed Niyas

  • 30 Posts
  • 2 Reply Likes
Eli,

We are fine with that timing. Could you please share your email id, so I can share the meeting link. 

Thanks,
Niyas