curl --request POST \
--url https://api-dev.narrative.io/mappings/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"attribute_id": 123,
"dataset_id": 456,
"mapping": {
"type": "object_mapping",
"property_mappings": [
{
"path": "product.brand",
"expression": "itemBrand"
},
{
"path": "product.category",
"expression": "itemCategory"
},
{
"path": "product.id.type",
"expression": "'SKU'"
},
{
"path": "product.id.value",
"expression": "itemID"
}
]
}
}
EOF{
"records": [
{
"input": {
"idType": "idType1",
"idValue": "idValue1"
},
"output": {
"unique_id_f7635d42_51ce_4535_ae8b_9ac64df85501": {
"type": "idType1",
"value": "idValue1"
}
}
},
{
"input": {
"idType": "idType2",
"idValue": "idValue2"
},
"output": {
"unique_id_f7635d42_51ce_4535_ae8b_9ac64df85501": {
"type": "idType2",
"value": "idValue2"
}
}
}
]
}Returns sampled dataset after attribute mapping for a given mapping.
This endpoint should be used when mapping does not exist.
A response is a list of JSON objects, where every object will have an input field, that represents the original key/value pairs from the dataset, and the output filed that will contain mapped fields where the key will be attribute name, and value will be JSON object of key/value pairs.
curl --request POST \
--url https://api-dev.narrative.io/mappings/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"attribute_id": 123,
"dataset_id": 456,
"mapping": {
"type": "object_mapping",
"property_mappings": [
{
"path": "product.brand",
"expression": "itemBrand"
},
{
"path": "product.category",
"expression": "itemCategory"
},
{
"path": "product.id.type",
"expression": "'SKU'"
},
{
"path": "product.id.value",
"expression": "itemID"
}
]
}
}
EOF{
"records": [
{
"input": {
"idType": "idType1",
"idValue": "idValue1"
},
"output": {
"unique_id_f7635d42_51ce_4535_ae8b_9ac64df85501": {
"type": "idType1",
"value": "idValue1"
}
}
},
{
"input": {
"idType": "idType2",
"idValue": "idValue2"
},
"output": {
"unique_id_f7635d42_51ce_4535_ae8b_9ac64df85501": {
"type": "idType2",
"value": "idValue2"
}
}
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The number of rows to sample from the dataset.
x <= 1000OK