Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

RESTful access to Files

avatar
New Contributor

Hello,

Looking for a RESTful API to upload to the https://<cdsw-domain>.com/<uname>/<project-name>/files

Does this exist? I know on File UI in the browser has the Upload button -- but we are looking for a RESTful endpoint.

Thanks, Jim

 

1 REPLY 1

avatar
Super Guru

@JimAtWork ,

 

The endpoint you're looking for is /api/v1/projects/{user}/{project_name}/files/{filename}.

 

For example, you can upload a file to a project with the following curl command:

curl \
  -u myuser:mypwd \
  -X PUT \
  "http://cdsw.example.com/api/v1/projects/myuser/myproject/files/myfile.txt" \
  -F "files[]=@myfile.txt"

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.