7.1. Upload

To associate files with Test Cases and Executions. they should be uploaded through an API call first and then the returned file hash should be sent in post data of API call in which you want the file to get associated.

Request and return format of uploading attachments is different than other API calls.

URL: /api/upload/{YOUR_API_KEY}

In this request, API key should be sent in the URL itself. instead of $_GET parameter. 

Request should be simple post, no json is required.

File content should be sent in "file" key of post.

Please see the example below:

Example Request:

curl  -F file=@"~/Desktop/image.png" http://your-testcollab-url.com/index.php/api/upload/yourapikey

Example Response:

{"response":{"message":"File uploaded.","filehash":"fgzwncpx88fh4gp"},"status":"pass"}

 filehash should be passed in your Test Case or Execution Case to associate that Attachment.

This page was: Helpful | Not Helpful
Test Case Management
Test Collab Support
Product Tour