Could not upload file by providing path using sharefile API

  • 1
  • Problem
  • Updated 6 months ago

Hi,


I am using Sharefile API to transfer the files from the local folder to Sharefile path.

I can send the file by providing the folder id as mentioned below:

https://<mycompany>.sharefile.com/sf/v3/Items(foxxxx-xxxxx-xxxx)/Upload

However, if I change the id to the folder path, I am not getting the response from the server.

I tried:

https://<mycompany>.sharefile.com/sf/v3/Items/ByPath?path=/My folder/EMP1/Archive/Upload

and

https://<mycompany>.sharefile.com/sf/v3/Items/ByPath?path=/My folder/EMP1/Archive//Upload

I am getting error 404 in the above 2 cases.

I need help with creating the URI for Upload providing the SF folder path.

Thanks in anticipation.

Regards,

Prashant

Photo of Prashant Bhatt

Prashant Bhatt

  • 5 Posts
  • 0 Reply Likes

Posted 6 months ago

  • 1
Photo of Dale Smith

Dale Smith, Employee

  • 123 Posts
  • 18 Reply Likes
Hi Prashant,

The /ByPath endpoint is only a GET endpoint. Our upload endpoint only allows by the folder id that you want to upload to. You will need to first do the GET on the ByPath, retrieving the id of the parent folder you want to upload to, and then upload using that id.

For more information on the endpoints we expose, you can look here: http://api.sharefile.com/rest/docs/resource.aspx?name=Items

Thanks,
Dale Smith