Upload or Update Files to Shared Folder
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 shared folder.
Caution: If you do not know the folderId
of the shared folder, use List Shared Folders to return a list of your created shared folders.
Get Signed URL for Folder
API Explorer: folders//s3/sign
First, use the folderId
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 folderId
of 5b7dc9c6c7dc9739167b23c8
and a fileName
of colors.csv
. Replace colors.csv
with the actual file name, and 5b7dc9c6c7dc9739167b23c8
with your folderId
.
Upload or Update Files to Shared FolderGet Signed URL for Folder
curl 'https://a.blazemeter.com/api/v4/folders/5b7dc9c6c7dc9739167b23c8/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/organizations/123429/shared/ApiTest/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%2F20190309%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190309T154412Z&X-Amz-SignedHeaders=host%3Bx-amz-acl%3Bx-amz-server-side-encryption&X-Amz-Expires=1200&X-Amz-Signature=f48f6fdb85d8d928709b5d6193ba452c20684f14da2a89bee7b00f9854224a70"
}
Upload File to Signed URL for Folder
Once you have obtained the signed URL (in result
above), construct a PUT request with the file as your body.
Use the following template for the file path and name:
'@*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 to signed url given). Be sure to upload the updated file using the same file name.
Upload or Update Files to Shared FolderUpload File to Signed URL for Folder
curl 'https://blazemeter.s3.amazonaws.com/organizations/123429/shared/ApiTest/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%2F20190309%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190309T154412Z&X-Amz-SignedHeaders=host%3Bx-amz-acl%3Bx-amz-server-side-encryption&X-Amz-Expires=1200&X-Amz-Signature=f48f6fdb85d8d928709b5d6193ba452c20684f14da2a89bee7b00f9854224a70' \
-X PUT \
-H 'Content-Type: application/octet-stream' \
--data-binary '@/my/path/to/colors.csv'
Shared Folder 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.
Response200 OK