Use the compressedBinaryDataFileId property
Use the compressedBinaryDataFileId property
Use the compressedBinaryDataFileId
property when you want to push 256 MB or less of compressed or uncompressed, binary or non-binary item data.
Using this property to push item data involves three distinct steps which are detailed in this article.
Step 1: Create a file container
The first thing you need to do is to perform a POST /files
HTTP request.
Step 2: Upload the item data into the file container
Next, you need to perform the following PUT uploadUri
request to upload your item data into the Amazon S3 file container you got from step 1.
Request template
Request definition
|
Replace:
Don’t Base64 encode your item data. |
Sample request
The following example shows how to upload Deflate compressed item data.
Request definition
|
Request body
|
Successful response - 200 OK
|
Step 3: Use the fileId as the CompressedBinaryDataFileId
value
Once the request you performed in step 2 has successfully returned, you can use the fileId
you got from step 1 as the compressedBinaryDataFileId
property value.
Use the compressedBinaryDataFileId
property when pushing a single item
The following example shows how you can use the compressedBinaryDataFileId
property to specify item data when performing a single push operation (see Add or update a single item in a Push source).
When using the
Those values are case sensitive.
The default value is |
Sample request
Request definition
|
Request body
|
Successful response - 202 Accepted
|
Use the compressedBinaryDataFileId
property when uploading a batch of items
Using the compressedBinaryDataFileId
property to upload a batch of items involves more steps.
Step 3.1: Create a file container
Use the POST /files
HTTP request to create a new Amazon S3 file container, this time for your batch of items.
Step 3.2: Upload the batch of items using the compressedBinaryDataFileId
property
Upload your batch of items into your newly created file container using the PUT uploadUri
HTTP request.
In the target item metadata, use the CompressedBinaryDataFileId
property to refer to the file container in which you uploaded item data at step 2.
When using the
These values are case sensitive. The default value is |
Sample request
The following example shows how to upload a batch of items to a file container, referring to an uploaded compressedBinaryDataFileId
in an item.
Request definition
|
Request body
|
Successful response - 200 OK
|
Step 3.3: Push the file container into your push source
Push the file container in which you just uploaded your batch of items into your source using the PUT /sources/{sourceId}/documents/batch
HTTP request.