+49 69 83008980 service@xqueue.com
Benötigen Sie Hilfe?

Im Maileon Help-Center finden Sie umfassende Dokumentationen zu unserem System.

Beliebte Suchanfragen: Importe | Rest-API | Integrationen | SMS

Create Data Extension

Sie sind hier:

Create a new data extension. Returns the ID of the newly created data extension on success.

POST https://api.maileon.com/1.0/dataextensions

Attributes

The body has the media type application/vnd.maileon.api+json and contains a list of data extension fields. A data extension has the following attributes:

Attribute Required Description
name yes The name of the data extension to use.

Must be unique.

description no A description to summarize the data extension.
retention_policy yes Lets you define a deletion strategy for each entry.

Possible values are:

  • NONE
  • EXTENSION_DATE
  • EXTENSION_DURATION
  • EXTENSION_DURATION_RENEW_ON_MODIFICATION
  • RECORDS_DURATION
delete_date yes, if retention_policy is set to EXTENSION_DATE and if delete_date_as_long is not set A date string in the format „Y-m-d“, „Y-m-d H:i:s“ or „Y-m-dTH:i:sZ“.
delete_date_as_long yes, if retention_policy is set to EXTENSION_DATE and if delete_date is not set A timestamp in microseconds (timestamp * 1000).
delete_interval yes, if retention_policy is set to EXTENSION_DURATION, EXTENSION_DURATION_RENEW_ON_MODIFICATION or RECORDS_DURATION The amount of interval units as integer.
delete_interval_unit yes, if retention_policy is set to EXTENSION_DURATION, EXTENSION_DURATION_RENEW_ON_MODIFICATION or RECORDS_DURATION The date interval unit.

Possible values are:

  • DAYS
  • WEEKS
  • MONTH
fields yes A list of data fields contained in the data extension.

At least one field acting as a unique_identifier is required in the list.

fields.name yes The name of the data extension field.

Must be unique in the list.

fields.description no A short summary of the data extension field.
fields.nullable yes A boolean flag describing if the field may be empty (null) when adding new entries.
fields.unique_identifier yes* A boolean flag to set the unique_identifier of the data extension fields.

At least one and only one field must be a unique_identifier.

fields.data_type yes The data type of the data extension field.

Possible values are:

  • contact_email
  • contact_external_id
  • string
  • double
  • integer
  • boolean
  • date
  • timestamp
fields.default_value no A default value if the field is missing when adding new entries.

Must comply to the data_type.

Response

HTTP status code Description
201 Created Data extension has been created successfully. The ID can be found in the response body.
400 Bad Request If there was an error in the submitted body. In this case, an XML-form error message that explains the problem is produced.

Example

POST https://api.maileon.com/1.0/dataextensions
Authorization: Basic XXXXXXXXXXXXXXX
Content-Type: application/vnd.maileon.api+json

{
  "name": "Name",
  "description": "Description",
  "retention_policy": "RECORDS_DURATION",
  "delete_interval": 7,
  "delete_interval_unit": "DAYS",
  "fields": [
    {
      "name": "id",
      "description": "A unique ID",
      "nullable": false,
      "unique_identifier": true,
      "data_type": "integer"
    },
    {
      "name": "email",
      "description": "The contact's email address",
      "nullable": false,
      "unique_identifier": true,
      "data_type": "contact_email"
    },
    {
      "name": "text",
      "description": "Some description for this field",
      "nullable": true,
      "unique_identifier": false,
      "data_type": "string",
      "default_value": "lorem ipsum"
    }
  ]
}

201 Created

123
Inhaltsverzeichnis