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
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:
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:
2psE3ESTtiDMckG87UUB7X
1X1q0iU1qouUy6gVyQJd0z
3elWf51hv9WUZhKUhITqWz
2Gc9CBAD2X1O27cFFu9keo
S0lzFpbFdYw8ppsSP2WKa
3dWp56C01zc7p3pJqJwM5T
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" https://api2.clarizen.com/v2.0/services/files/<UPLOADFILECODE>/uploadFile
Any help would be greatly appreciated.
Please sign in to leave a 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