Use the compressedBinaryData property

You can use the compressedBinaryData property when you want to push 5 MB or less of uncompressed, or Deflate, GZip, LZMA, or ZLib compressed, then Base64 encoded binary or non-binary item data.

Use the compressedBinaryData property when pushing a single item

The following example shows how you can use the compressedBinaryData property to specify item data when performing the Add or update an item HTTP request.

Important

When using the compressedBinaryData property to push a single item, your query string should include the compressionType parameter along with the compression algorithm that was applied to the data:

  • UNCOMPRESSED

  • DEFLATE

  • GZIP

  • LZMA

  • ZLIB

Those values are case sensitive. The default value is ZLIB.

Sample request

PUT https://api.cloud.coveo.com/push/v1/organizations/mycoveocloudv2organizationg8tp8wu3/sources/mycoveocloudv2organization-rp5rxzbdz753uhndklv2ztkfgy/documents?documentId=file://example.html&compressionType=DEFLATE HTTP/1.1

Content-Type: application/json
Accept: application/json
Authorization: Bearer **********-****-****-****-************

Request body:

{
  // ...Item metadata...
  "compressedBinaryData": "ZUp5enlTakp6YkhqVWdBQ200elV4QlFvVXgrSm5aU2ZVZ2xoUWxRWjJybFdKT1lXNUtRQ1ZSa2lTUlRZaFdSa0Zpc0FVV0tlUWlwRWlaNk5mb0VkRjZlTlBzUVFvQTZRZFFETWhCOEU=",
  "fileExtension": ".html",
  // ...Item permission model (if applicable)...
}

Use the compressedBinaryData property when uploading a batch of items

The following example shows how you can use the compressedBinaryData property to specify item data when performing a PUT uploadUri HTTP request.

Important

When using the compressedBinaryData property to push the data of an item in a batch, the document body this item should include the compressionType property along with the compression algorithm that was applied on the data:

  • "UNCOMPRESSED"

  • "DEFLATE"

  • "GZIP"

  • "LZMA"

  • "ZLIB"

Those values are case sensitive. The default value is "ZLIB".

Sample request

PUT link:https://coveo-nprod-customerdata.s3.amazonaws.com/proda/blobstore/mycoveocloudv2organizationg8tp8wu3/b5e8767e-8f0d-4a89-9095-1127915c89c7[...] HTTP/1.1

x-amz-server-side-encryption: AES256
Content-Type: application/octet-stream

Request body:

{
  "AddOrUpdate": [
    {
      // ...Item metadata...
      "documentId": "file://example.html",
      "compressedBinaryData": "ZUp5enlTakp6YkhqVWdBQ200elV4QlFvVXgrSm5aU2ZVZ2xoUWxRWjJybFdKT1lXNUtRQ1ZSa2lTUlRZaFdSa0Zpc0FVV0tlUWlwRWlaNk5mb0VkRjZlTlBzUVFvQTZRZFFETWhCOEU=",
      "compressionType": "DEFLATE",
      "fileExtension": ".html",
      // ...Item permission model (if applicable)...
    },
    // ...More items to add or update...
  ],
  "delete": [
    // ...Items to delete...
  ]
}