I encountered an error while migrating to the new version API (/api/v1/testcase/upload-attachment/:id ). I’m not sure if I missed any parameters or if there’s any prerequisite work that needs to be done before calling this API.
7 Answers
7Please make sure that your api key has at least “Editor” permissions, without it, you cannot add attachments to test cases (the error message is a little misleading)
To upload attachments to a test result in a specific run, use
/api/v1/testrun/upload-attachment/:trId/:tcId instead
If you are importing automated test results, you might want to use our new “Automation” feature instead:
This provides tooling and comprehensive API to import automated test reports (e.g. like JUnit)
Thanks for your reply. The API endpoint /api/v1/testrun/upload-attachment/:trId/:tcId is working now, but we’re unable to view the uploaded attachments in Testiny.
Please make sure that you are uploading the attachment data (in your case the image) “as is” in the request body, not wrapped in json (or base64 encoded).
The meta data values like mime_type(if not present the request content type will be used), filename, title should be in the query params:
As said above, you need to use binary data, not base64. So the data options should look like this, with “filename” being the name of the file you want to upload:
curl ... --data @filename
Make sure to use the @ sign to signal a file name.
Best regards,
Alex
It works now, thanks so much!




when adding an attachment to the test run result, it is only visible in the "comments" tab when viewing that testcase in that specific test run, not on the testcase itself
– mgi