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
extension_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": {
      "default_value": "sentinel",
      "delegate_descriptor_id": "EPc9ce7e7145a3406f9d9d73a16c925ca2::dataElements::dom-attribute",
      "enabled": true,
      "extension_id": "EX3286622d06a64c3aaf0229ffe2fff415",
      "force_lower_case": true,
      "name": "My Data Element",
      "clean_text": true,
      "settings": "{\"elementSelector\":\".target-element\",\"elementProperty\":\"html\"}",
      "storage_duration": "session"
    },
    "type": "data_elements"
  }
}'

Example Response

201 Created
{
  "data": {
    "id": "DEcfcc6a2e515f4ef792d207a9eb390ce3",
    "type": "data_elements",
    "attributes": {
      "created_at": "2018-06-15T19:09:25.795Z",
      "dirty": true,
      "enabled": true,
      "name": "My Data Element",
      "published": false,
      "published_at": null,
      "revision_number": 0,
      "updated_at": "2018-06-15T19:09:25.795Z",
      "clean_text": true,
      "default_value": "sentinel",
      "delegate_descriptor_id": "EPc9ce7e7145a3406f9d9d73a16c925ca2::dataElements::dom-attribute",
      "force_lower_case": true,
      "review_status": "unsubmitted",
      "storage_duration": "session",
      "settings": "{\"elementSelector\":\".target-element\",\"elementProperty\":\"html\"}"
    },
    "relationships": {
      "libraries": {
        "links": {
          "related": "http://localhost:9010/data_elements/DEcfcc6a2e515f4ef792d207a9eb390ce3/libraries"
        }
      },
      "revisions": {
        "links": {
          "related": "http://localhost:9010/data_elements/DEcfcc6a2e515f4ef792d207a9eb390ce3/revisions"
        }
      },
      "property": {
        "links": {
          "related": "http://localhost:9010/data_elements/DEcfcc6a2e515f4ef792d207a9eb390ce3/property"
        },
        "data": {
          "type": "properties",
          "id": "PR2ecc457477a34301a7ed627ec454d632"
        }
      },
      "origin": {
        "links": {
          "related": "http://localhost:9010/data_elements/DEcfcc6a2e515f4ef792d207a9eb390ce3/origin"
        },
        "data": {
          "type": "data_elements",
          "id": "DEcfcc6a2e515f4ef792d207a9eb390ce3"
        }
      },
      "extension": {
        "links": {
          "related": "http://localhost:9010/data_elements/DEcfcc6a2e515f4ef792d207a9eb390ce3/extension"
        },
        "data": {
          "type": "extensions",
          "id": "EX3286622d06a64c3aaf0229ffe2fff415"
        }
      }
    },
    "links": {
      "property": "http://localhost:9010/properties/PR2ecc457477a34301a7ed627ec454d632",
      "origin": "http://localhost:9010/data_elements/DEcfcc6a2e515f4ef792d207a9eb390ce3",
      "self": "http://localhost:9010/data_elements/DEcfcc6a2e515f4ef792d207a9eb390ce3",
      "extension": "http://localhost:9010/extensions/EX3286622d06a64c3aaf0229ffe2fff415"
    },
    "meta": {
      "latest_revision_number": 0
    }
  }
}