Skip to main content
POST
/
mappings
/
test
Test Mapping
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"
        }
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

size
integer

The number of rows to sample from the dataset.

Required range: x <= 1000

Body

application/json
attribute_id
integer

The target attribute's ID.

dataset_id
integer

The source dataset's ID.

mapping
object

Mapping definition for create/update requests. Dependencies are computed server-side and not provided by the client.

Response

200 - application/json

OK

records
object[]