2 followers Follow

Upload File Through API

I'm having trouble figuring out the correct POST statement to upload a file through the API.

I've been using the following steps provided in this post:


  1. Create a Document object using;
  2. Create an AttachmentLink object between the project and the document created in step 1 using;
  3. Perform GET on;
  4. Perform POST of your file to the URL returned by step 3;
  5. Perform POST on with documentId(entityId) from step 1 and fileInformation parameters to attach the file to the project.


I have tried POSTing my locally stored file to the URL I received in Step 3 over and over, but it continually doesn't work. I'm simply trying this through curl right now, and everything works great until I get to Step 4: 
"Perform POST of your file to the URL returned by GetUploadUrl"


The closest I've gotten is receiving the following individual error codes after each separate attempt that I'm hoping you can look up in the logs to tell me what I'm missing:







The error message text preceding the code was:

"WeΓÇÖre sorry, something seems to have gone wrong. If you want our team to investigate please open a support ticket and include this error code"

Unfortunately, when I opened a ticket, I was told they couldn't help because this is an API call and I should post on this forum instead.


Ideally, can you provide me with an example post statement that should be successful? 


Do I need to include the ApiKey authorization or not? I've tried both ways. I've also tried with single, double, and no quotes just to cover my bases. Single quotes return a message of being unable to read the file, but double quotes and no quotes give me the Clarizen error message and a code as mentioned above.


I've also tried relative and absolute local paths but they act the same.


Here's one example of what I've tried running:

curl -F "data=@testfile.jpg"<UPLOADFILECODE>/uploadFile


Any help would be greatly appreciated. 

Chad Davis Answered

Please sign in to leave a comment.

1 comment


Hello Chad,

I don't think this will work with a local file. I think the file needs to be on a server.

Due to this, I can't really test this myself. I'll see if I can get you an example though.


Roland Pumputis 0 votes
Comment actions Permalink