Back to top

Datasembly Data Ingest Webhook

Data ingest webhooks are used to send data to Datasembly over HTTPS.

The following are required to use these webhook endpoints:

  • A client code provided by Datasembly

  • A secret code provided by Datasembly

  • Ability to use HmacSHA256 to generate a signature for each request body using the secret

The code uniquely identifies you on the Datasembly system. The secret is also unique to you and should not be shared. If the secret is compromised, please contact Datasembly immediately so the secret can be rotated.

Datasembly webhooks are secured and verified by a signature calculated from the webhook request body. The client must calculate the signature of the request body using HmacSHA256 and the secret and include the result in the ds-signature header on the request. The ds-signature header value must be base64 encoded. In pseudocode:

ds-signature: base64_encode(hmac_sha256(request_body_bytes, secret))

Currently, the only ingest webhook available is for product listings. Documentation for the product listings webhook endpoint is below.

Webhook endpoints

Submit manually collected product listings

Submit manually collected product listings
POST/v2/ingest/productlistings/manual/{code}

Example URI

POST https://api.datasembly.com/v2/ingest/productlistings/manual/code
URI Parameters
HideShow
code
string (required) 

client code provided by Datasembly

Request
HideShow
Headers
Content-Type: application/json
ds-signature: Base64 encoded HmacSHA256 calculated with secret provided by Datasembly
Body
{
  "listings": [
    {
      "timestamp": "2021-03-01T01:44:35Z",
      "retailer": "Kroger",
      "latitude": 30.21008,
      "longitude": -95.52763,
      "barcode": "016000401068",
      "sku": "57123",
      "price": 4.99,
      "salePrice": 4.25,
      "imageLabelUrl": "https://example.com/image_label_1.jpg",
      "imageBarcodeUrl": "https://example.com/image_barcode_1.jpg",
      "imagePriceTagUrl": "https://example.com/image_price_tag_1.jpg"
    },
    {
      "timestamp": "2021-03-02T18:17:12Z",
      "retailer": "Walmart",
      "latitude": 30.210446,
      "longitude": -95.461962,
      "barcode": "01600012479",
      "sku": "685-781",
      "price": 2.99,
      "salePrice": null,
      "imageLabelUrl": "https://example.com/image_label_2.jpg",
      "imageBarcodeUrl": "https://example.com/image_barcode_2.jpg",
      "imagePriceTagUrl": "https://example.com/image_price_tag_2.jpg"
    }
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "count": 2
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "success": false,
  "error": "missing field timestamp"
}

Generated by aglio on 19 Oct 2023