Upload or Update Data Files

To upload or update an asset file, first get a signed URL, and then use it to upload the file.

If you are a private cloud user, please see this link for the steps for uploading data files to a multi-test.

Get Signed URL

API Explorer: /collections/{collectionId}/s3/sign

First, use the collectionId and fileName to get a signed URL, which will later be used to upload the specified file to the test. The sample code returns a URL for a collectionId of 10027459 and a fileName of colors.csv. Replace colors.csv with the actual file name, and 10027459 with your collectionId.

Upload or Update Data FilesGet Signed URL

curl 'https://a.blazemeter.com/api/v4/collections/12345678/s3/sign?fileName=colors.csv' \
						-H 'Content-Type: application/json' \
						--user 'api_key_id:api_key_secret'
				

Response200 OK

{
						"api_version": 4,
						"error": null,
						"result": "https://blazemeter.s3.amazonaws.com/users/123456/collections/12345678/data/colors.csv?x-amz-acl=private&x-amz-server-side-encryption=AES256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJPZOF6U7I33QK2CQ%2F20190308%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190308T215448Z&X-Amz-SignedHeaders=host%3Bx-amz-acl%3Bx-amz-server-side-encryption&X-Amz-Expires=1200&X-Amz-Signature=dd007f7bc743928d9ea71e980e40569771d40a1277ecd53cffe672f1526d9e22"
						}
				

Upload File to Signed URL

Once you have obtained the signed URL (from the result attribute of Get Signed URL section), construct a PUT request with the file as your body. Use the following template for the file path and name:

'file=@*path to file*/*file*.*ext*'

In the example to the right, replace @/my/path/to/colors.csv with the actual path and file name.

To update the contents of an uploaded file, repeat the same two-step operation (GET signed url, PUT the file in the signed url given). Be sure to upload the updated file using the same file name.

Upload or Update Data FilesUpload File to Signed URL

curl 'https://blazemeter.s3.amazonaws.com/users/123456/collections/12345678/data/colors.csv?x-amz-acl=private&x-amz-server-side-encryption=AES256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJPZOF6U7I33QK2CQ%2F20190308%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190308T215448Z&X-Amz-SignedHeaders=host%3Bx-amz-acl%3Bx-amz-server-side-encryption&X-Amz-Expires=1200&X-Amz-Signature=dd007f7bc743928d9ea71e980e40569771d40a1277ecd53cffe672f1526d9e22' \
						-X PUT \
						-H 'Content-Type: application/json' \
						--data-binary '@/my/path/to/colors.csv'
				

Response200 OK

Data File Requirements

The file naming requirements, limitations on file content, file size and impact of uploaded files on start time remain the same as the single test.