Send Your Data - Bloomreach Experience - Open Source CMS

Send Your Data

In Pre-Launch Phase

The latest DataConnect features are slated for launch in Q3 2020. To learn more about this feature reach out to your Bloomreach representative.

Before sending your feed to Bloomreach, ensure that you have the following:

  • Feed(s) - Created your feed according to Format your Data
  • Transfer Key - API key used for authentication, unique to your merchant account. If you do not already have it, speak to your Bloomreach representative.
  • Catalog names - Catalog names used in the DataConnect API endpoints. You should have received these during content search setup.
  • Authorization token - Required for the DataConnect API requests. You should have received this during content search setup.

Then, follow these steps to send your content feed to Bloomreach:

For full feeds

  1. Upload the full feed to your Bloomreach SFTP
  2. Send the DataConnect PUT API request
  3. Run the index API

For delta feeds

  1. Upload the delta feed to your Bloomreach SFTP
  2. Send the DataConnect PATCH API request
  3. If order of data is important, wait for PATCH job to finish
  4. Run the index API

Upload Feed to SFTP

Your content feed is a jsonl file that you can send to Bloomreach by uploading it to an SFTP location. To do this, run the following commands via OpenSSH or Firezilla:

Upload to SFTP using OpenSSH

  1. On Linux or Mac, open a command terminal.

  2. Enter the following command:

    %sftp -i transfer-key [email protected]_endpoint

    Replace transfer-key with your Bloomreach Transfer Key, sftp_user with your account name, and service_endpoint with the endpoint for staging or production. You should have received these during account setup.
    Staging endpoint: sftp-staging.connect.bloomreach.com
    Production endpoint: sftp.connect.bloomreach.com

  3. You will be shown a sftp prompt, like sftp>
  4. Enter pwd to begin file transfer

    sftp> pwd
    
  5. Enter the following command:

    sftp> put filename.jsonl

    Replace filename with your jsonl file path.

  6. The put command transfers the file into the SFTP location, and should display a message similar to the following:

    Uploading filename.jsonl to /home/sftp_user/filename.jsonl
    some-file.txt 100% 127 0.1KB/s 00:00 

Upload to SFTP using FileZilla

  1. Choose Connect to open the Connection dialog box.
  2. In the list at the top, choose SFTP as the protocol.
  3. For Port, enter 22.
  4. For Server, enter the endpoint for staging or production. 
    Staging endpoint: sftp-staging.connect.bloomreach.com 
    Production endpoint: sftp.connect.bloomreach.com

  5. Choose Browse and select the SSH private key into the FileZilla connection. Read here for more information on how to generate the SSH private and public key pair.
  6. Click Connect.
  7. Select the files and upload it to the required location.

Send the DataConnect API Request

Send DataConnect request using an HTTPS API interacting tool

  1. Open the tool and select the request method as PUT (for full feeds) or PATCH (for delta feeds).
  2. Enter the following request URL, replacing account_id with your account ID, and catalog_name with the name of the catalog you want the feed to belong to 

https://api.connect.bloomreach.com/api/v1/accounts/{account_id}/catalogs/{catalog_name}/items
  1. Configure these two headers:
    1. Authorization as “Bearer <token>”. Replace <token> with the authorization token you received during account setup.
    2. Content-Type as "application/json"
  2. Send the API request using SFTP file paths or a JSON string.

    1. SFTP file path: You can send your data as a list of file paths to your feed uploaded to your Bloomreach SFTP location. The file paths must be relative.

      [
         "</filename.jsonl>",
      
         "</uploads/filename.jsonl>"
      
      ]
    2. JSON string: You can alternatively send your data as a JSON string along with the API request, but you must change your Content-Type header to "application/json-patch+json". The JSON string size can be up to 5 MB.

      {
         "op":"add",
         "path":"/items/awesome-omelette",
         "value":{
            "attributes":{
            }
         }
      }
      

Send DataConnect request using curl

Another way to send the DataConnect API request is via curl. You can use the curl below to execute a DataConnect API request. 

curl -X PUT \

 https://api.connect.bloomreach.com/api/v1/accounts/{account_id}/catalogs/{catalog_name}/items \

 -H 'Authorization: Bearer <token>' \

 -H 'Content-Type: application/json' \ 

 -d '[
       "</filename.jsonl>",

       "</uploads/filename.jsonl>"
 ]'

Use PUT (for full feeds) or PATCH (for delta feeds). Replace account_id with your account ID, and catalog_name with the name of the catalog you want the feed to belong to. Replace <token> with the authorization token you received during account setup.

Run the index API

If you intend to configure your attributes, we recommend that you finish configuration before running the Index API. If you do not need to configure your attributes, then proceed to run the Index API.

The Index API enables you to index your content feed and can be called after calling the DataConnect PUT or PATCH API. If you have multiple PATCH requests that need to be indexed for the same catalog, you only need to call the Index API once to index all of them. If you want data to be uploaded in the order it was sent, then you should allow the PUT/PATCH jobs to finish before running the Index API. 

Content from newly sent feeds will not be searchable until you call the Index API. Likewise, changes to make an attribute searchable or not searchable will not be applied until you call the Index API. If you have recently sent a feed or configured your attributes but your content search isn’t working as expected, try running the Index API again.
  1. Send a POST request to the Index API endpoint

http://api.connect.bloomreach.com/api/v1/accounts/{account_id}/catalogs/{catalog_name}/indexes
  1. Replace {account_id} with your account id and {catalog_name} with the desired catalog name
  2. Leave the request body blank

You can view the feed status or the publish index status under your respective catalog’s feed status in DataConnect. Please note that Bloomreach processes the index requests sequentially, so there may be a delay before you can see results, depending on the amount of data and index API requests you have queued.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?