Skip to content

Upload API

Gaffer Upload API

Gaffer’s Upload API allows you to upload test reports to Gaffer. The API accepts multipart form data containing your test report files and metadata.

Required Headers

HeaderDescription
X-Gaffer-API-KeyYour Gaffer project API key
Content-TypePreferably multipart/form-data

Request Parameters

FieldTypeDescription
run_packageFilesThe test report file(s) to upload. Can include multiple files, but must include at least one HTML report.
tags.key[]StringKeys for metadata tags. Can include multiple tags.
tags.value[]StringValues for metadata tags. Must match the number of tag keys.

Accepted tags

TagDescriptionRequired
commit_shaThe commit SHA that the test report is for.Strongly recommended
branchThe branch that the test report is for.No
test_frameworkThe test framework that the test report is for.No
test_suiteAn optional label for the name of the test suite.No

Response

The response will be a JSON object containing the following fields:

FieldDescription
statusThe status code of the request.
statusTextThe status message of the request.
data.reportUrlThe URL of the uploaded test report.

Example Request

curl.sh
curl -X POST https://api.gaffer.sh/upload \
-H "X-Gaffer-API-Key: YOUR_API_KEY" \
-F "run_package=@path/to/test_report.html;filename=test_report.html" \
-F "tags.key=commit_sha" \
-F "tags.value=ab12cd34ef56gh78ij90klmnop" \
-F "tags.key=test_framework" \
-F "tags.value=playwright" \
-F "tags.key=branch" \
-F "tags.value=main" \
-F "tags.key=test_suite" \
-F "tags.value=smoke"