Note: All image urls which the API generate are time sensitive and are only valid for a short period of time.
Show
Description: Get the details for a test case upload.
Endpoint: <base_url>/projects/{project_id}/suites/{suite_id}/steps/{step_id}/step_uploads/{id}.json
Request: GET
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- suite_id - {Integer} The associated suite ID (Required)
- step_id - {Integer} The test case ID (Required)
- id - {Integer} The test case upload ID (Required)
Response
{
....
}
Example ruby request
HTTParty.get('https://api.testlodge.com/v1/account/1/projects/1/suites/1/steps/1/step_uploads/1.json')
Example Response
Response code: 200
{
"id":1,
"file_name":"image.jpg",
"content_type": "image/jpeg",
"paths": {
"original": {
"name":"original",
"geometry": null,
"url":"http://s3.amazonaws.com/path/to/image"
},
"thumbnail": {
"name":"thumbnail",
"geometry":"100x100#",
"url":"http://s3.amazonaws.com/path/to/image"
},
"medium": {
"name":"thumbnail",
"geometry":"525x390>",
"url":"http://s3.amazonaws.com/path/to/image"
}
}
}
Create
Description: Create a new test case upload and attach to associated test case.
Endpoint: <base_url>/projects/{project_id}/suites/{suite_id}/steps/{step_id}/step_uploads.json
Request: POST (Must be a multipart request)
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- suite_id - {Integer} The associated suite ID (Required)
- step_id - {Integer} The test case ID (Required)
- id - {Integer} The test case upload ID (Required)
- step_upload
- file - {Image} The image file that you would like to upload (Required)
Response
{
....
}
Example ruby request
require 'net/http/post/multipart'
url = URI.parse("https://api.testlodge.com/v1/account/1/projects/1/suites/1/steps/1/step_uploads.json")
req = Net::HTTP::Post::Multipart.new url.path,
"step_upload[file]" => UploadIO.new(File.new("/sample_images/image.jpg"), "image/jpeg", "image.jpg")
res = Net::HTTP.start(url.host, url.port) do |http|
http.request(req)
end
Example Response
Response code: 201
{
"id":1,
"file_name":"image.jpg",
"content_type": "image/jpeg",
"paths": {
"original": {
"name":"original",
"geometry": null,
"url":"http://s3.amazonaws.com/path/to/image"
},
"thumbnail": {
"name":"thumbnail",
"geometry":"100x100#",
"url":"http://s3.amazonaws.com/path/to/image"
},
"medium": {
"name":"thumbnail",
"geometry":"525x390>",
"url":"http://s3.amazonaws.com/path/to/image"
}
}
}
Delete
Description: Delete a test case upload.
Endpoint: <base_url>/projects/{project_id}/suites/{suite_id}/steps/{step_id}/step_uploads/{id}.json
Request: DELETE
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- suite_id - {Integer} The associated suite ID (Required)
- step_id - {Integer} The test case ID (Required)
- id - {Integer} The test case upload ID (Required)
Response
{ }
Example ruby request
HTTParty.delete('https://api.testlodge.com/v1/account/1/projects/1/suites/1/steps/1/step_uploads/1.json')
Example Response
Response code: 204
{ }
Comments
Article is closed for comments.