Callback Format

The response field, which is part of the callback POST request and stored as part of the job object, will follow one of two possible schemas:

  • if product_variant was provided, the response will contain an attributes field and, if applicable, a warnings field
  • if catalog_key was provided, the response will contain an attributes_uri field and, if applicable, a warnings_uri field

Single - product_variant

The attributes field is a set of key-value pairs where the key is the attribute of type string and value is an object containing what was extracted / inferred from the request inputs for that attribute. If an attribute was not found in the request inputs, then it will not be returned in this mapping.

If there are any issues detected with the input format during the job, the response will contain a warnings field. The warnings field is an object and currently outputs one type of issue - invalid_image_urls.

{
  "job_id": "23c2343244d2343a6743242a",
  "type": "attribute_enrichment",
  "status": "completed",
  "response": {
    "attributes": {
      "sleeve_length": {
        "values": ["short"]
      },
      "pattern": {
        "values": ["solid print"]
      },
      "neckline": {
        "values": ["crew neckline"]
      },
      "collar_style": {
        "values": ["crew neck"]
      },
      "shirt_fit": {
        "values": ["relaxed fit"]
      },
      "style": {
        "values": ["elegant"]
      }
    }
  }
}

Batch - catalog_key

The attributes_uri field will contain a signed S3 link that points to the response to the batch job.

{
  "job_id": "23c2343244d2343a6743242a",
  "type": "attribute_enrichment",
  "status": "completed",
  "response": {
    "attributes_uri": "https://s3.labeling-data.net/scale-cds-public-us-west-2/60e548abbeeeca002d6754a0/sAmWlg7OWBmY8rh?Expires=1728000000&Key-Pair-Id=K3DN68TU3V3L3W&Signature=JaPCDU2DN5svRGTeygL2mlXBTCccMg3%7EWflkIm1QgXcrCJ3gU8%7EqMszpJ2fNwYuPIHDtZEKYdpCGgYuq4IqBWW1WpT0zZblw%7EGRgJgg39v4l17lvbor5q0PyK508jtgInh6GUooxnRFzp4yz3g88uok8kuA8PmRGJRQReCwAese13rZ%7EdCINyHJyRZJIc%7E1QJLUnRItuDkifsqmGyUiEy0hglqYPIpp5KYqLCLbmkBjwzSyEEKCTUWetBPxJnIOaS9JWM35ZV7RX0JRMNUmJZ2tmsTCN5l8xCrCKJ%7EThjz9S4EH6kETcLtFu8pGxto34OoDGdOs3KDO2FBavlx4jsA__"
  } 
}

At this link, you'll find an object whose keys are the product variant id and values are an attributes field and, if applicable, an error field. The attributes object has the same schema as the single case. The error object contains a message string that specifies the error that occurred.

Since an unexpected error might occur at the product variant level, we surface those errors on a per product variant basis. If there are an error at the job level, that will be surfaced as an error at the job level.

If there are any issues detected with the input format during the job, the response will contain a warnings_uri field that will contain a signed S3 link. At the link, you'll find an object whose keys are the product variant id and the values are a warnings field.

{
  "06f3986e-7014-43e6-9d12-7087ac232f76": {
    "attributes": {
      "sleeve_length": {
      	"values": ["short"]
      },
      "pattern": {
      	"values": ["solid print"]
      },
      "neckline": {
      	"values": ["crew neckline"]
      },
      "collar_style": {
      	"values": ["crew neck"]
      },
      "shirt_fit": {
      	"values": ["relaxed fit"]
      },
      "style": {
      	"values": ["elegant"]
      }
    }
  }
}