WARNING

WARNING: These APIs are currently in an 'alpha' state and are likely to change over time. We recommend you not use them in a production setting at this time!


Create a DataElement

Attributes

delegate_descriptor_id
string - required
name
string - required
User provided name for data element
clean_text
boolean - optional
Remove leading and trailing whitespace
default_value
string - optional
Value to return if data element evaluates to undefined
enabled
boolean - optional
force_lower_case
boolean - optional
Convert value to lowercase
settings
string - optional
Settings json object represented as a string
storage_duration
string - optional

Definition

POST  /properties/:property_id/data_elements

Example Request

curl https://mc-api-activation-reactor-integration.adobe.io/properties/:property_id/data_elements \
  -H "Accept: application/vnd.api+json;revision=1" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Authorization: Bearer [TOKEN]" \
  -H "X-Api-Key: [KEY]" \
  -X POST \
  -d \
'
{
  "data": {
    "attributes": {
      "name": "My Data Element",
      "delegate_descriptor_id": "kessel-test::dataElements::dom-attribute",
      "settings": "{\"elementSelector\":\".target-element\",\"elementProperty\":\"html\"}"
    },
    "relationships": {
      "extension": {
        "data": {
          "id": "EX921de417bc604e28b06aea0436d857c9",
          "type": "extensions"
        }
      }
    },
    "type": "data_elements"
  }
}'

Example Response

201 Created
{
  "data": {
    "id": "DE509ddc7378ff475da996d099b169caf6",
    "type": "data_elements",
    "attributes": {
      "created_at": "2018-08-31T16:49:09.011Z",
      "dirty": true,
      "enabled": true,
      "name": "My Data Element",
      "published": false,
      "published_at": null,
      "revision_number": 0,
      "updated_at": "2018-08-31T16:49:09.011Z",
      "clean_text": false,
      "default_value": "",
      "delegate_descriptor_id": "kessel-test::dataElements::dom-attribute",
      "force_lower_case": false,
      "review_status": "unsubmitted",
      "storage_duration": null,
      "settings": "{\"elementSelector\":\".target-element\",\"elementProperty\":\"html\"}"
    },
    "relationships": {
      "libraries": {
        "links": {
          "related": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6/libraries"
        }
      },
      "revisions": {
        "links": {
          "related": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6/revisions"
        }
      },
      "property": {
        "links": {
          "related": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6/property"
        },
        "data": {
          "id": "PRdee5593b9a934444a53243ffa2dde24f",
          "type": "properties"
        }
      },
      "origin": {
        "links": {
          "related": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6/origin"
        },
        "data": {
          "id": "DE509ddc7378ff475da996d099b169caf6",
          "type": "data_elements"
        }
      },
      "extension": {
        "links": {
          "related": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6/extension"
        },
        "data": {
          "id": "EX921de417bc604e28b06aea0436d857c9",
          "type": "extensions"
        }
      },
      "updated_with_extension_package": {
        "links": {
          "related": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6/updated_with_extension_package"
        },
        "data": {
          "id": "EP27e9323eb585411fae6086fc78a3b70b",
          "type": "extension_packages"
        }
      }
    },
    "links": {
      "property": "http://localhost:9010/properties/PRdee5593b9a934444a53243ffa2dde24f",
      "origin": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6",
      "self": "http://localhost:9010/data_elements/DE509ddc7378ff475da996d099b169caf6",
      "extension": "http://localhost:9010/extensions/EX921de417bc604e28b06aea0436d857c9"
    },
    "meta": {
      "latest_revision_number": 0
    }
  }
}