# Dotdigital

> Manage contacts, lists and email campaigns in Dotdigital, send transactional email, enrol contacts in programs, and follow new contacts, unsubscribes, sends, opens and clicks.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/dotdigital

## Actions

### Add contact to list

Add a contact to a list by email address, creating the contact if it is new.

**Inputs**

- List (`list_id`, number, required): The list (address book). At least 1.
- Email (`email`, text, required): The contact's email address.
- Opt-in type (`opt_in_type`, text): How the contact agreed to receive email. Verified double opt-in sends them a confirmation email. One of: `Unknown`, `Single` (Single opt-in), `Double` (Double opt-in), `VerifiedDouble` (Verified double opt-in (sends a confirmation email)).
- Email format (`email_type`, text): The format the contact gets emails in. One of: `Html`, `PlainText` (Plain text).

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "dataFields": [
      {
        "key": "example",
        "value": "example"
      }
    ],
    "email": "example",
    "emailType": "example",
    "id": 1,
    "optInType": "example",
    "status": "example"
  }
}
```

### Copy campaign

Make an unsent copy of a campaign, to change and send again.

**Inputs**

- Campaign (`campaign_id`, number, required): The email campaign. At least 1.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "fromAddress": {
      "email": "example",
      "id": 1
    },
    "fromName": "example",
    "id": 1,
    "isSplitTest": true,
    "name": "example",
    "replyAction": "example",
    "replyToAddress": "example",
    "status": "example",
    "subject": "example"
  }
}
```

### Create list

Create a list (address book).

**Inputs**

- Name (`name`, text, required): The list's name, up to 128 characters. It must be unique in the account.
- Visibility (`visibility`, text): Public lists can be offered to contacts on preference pages. Leave empty for private. One of: `Private`, `Public`.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "contacts": 1,
    "id": 1,
    "name": "example",
    "visibility": "example"
  }
}
```

### Create or update contact

Add a contact, or update the one with this email address. Only the fields filled in change.

**Inputs**

- Email (`email`, text, required): The contact's email address.
- Other data fields (`data_fields`, object): Other contact data fields to set, by their name in Dotdigital, such as POSTCODE.
- First name (`first_name`, text): The contact's first name (the FIRSTNAME data field).
- Last name (`last_name`, text): The contact's last name (the LASTNAME data field).
- Mobile number (`mobile_number`, text): The contact's mobile number in international format, such as 447700900184.
- Add to lists (`list_ids`, list): Lists to add the contact to. Lists they are already in are kept.
- Email subscription (`email_status`, text): Subscribe or unsubscribe the contact from email. Leave empty to keep it as it is (new contacts are subscribed). One of: `subscribed`, `unsubscribed`.
- Opt-in type (`opt_in_type`, text): How the contact agreed to receive email. Verified double opt-in sends them a confirmation email. One of: `single` (Single opt-in), `double` (Double opt-in), `verifiedDouble` (Verified double opt-in (sends a confirmation email)).
- Email format (`email_type`, text): The format the contact gets emails in. One of: `html`, `plainText` (Plain text).
- When a value already exists (`merge_option`, text): How new values combine with ones the contact already has. Leave empty to replace them. One of: `overwrite` (Replace existing values), `overwrite-if-not-empty` (Replace existing values, but skip blank ones), `overwrite-if-empty` (Fill in only values that are blank today).

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "channelProperties": {
      "email": {
        "emailType": "example",
        "openTracking": "example",
        "optInType": "example",
        "status": "example"
      },
      "sms": {
        "countryCode": "example",
        "status": "example"
      }
    },
    "contactId": 1,
    "created": "example",
    "dataFields": {},
    "identifiers": {
      "email": "example",
      "mobileNumber": "example"
    },
    "lists": [
      {
        "id": 1,
        "name": "example",
        "status": "example"
      }
    ],
    "status": "example",
    "updated": "example"
  }
}
```

### Delete campaign

Delete a campaign.

**Inputs**

- Campaign (`campaign_id`, number, required): The email campaign. At least 1.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {}
}
```

### Delete contact

Delete a contact from the account, and from every list.

**Inputs**

- Find contact by (`find_by`, text): What the contact is looked up by. Leave empty for email address. One of: `email` (Email address), `mobileNumber` (Mobile number), `contactId` (Contact ID). Default: `email`.
- Contact (`contact`, text, required): The contact's email address, mobile number (in international format, such as 447700900184) or contact ID, matching Find contact by.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "contactId": 1
  }
}
```

### Delete list

Delete a list. Its contacts stay in the account.

**Inputs**

- List (`list_id`, number, required): The list (address book). At least 1.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {}
}
```

### Enrol in program

Enrol contacts, or every contact in some lists, in an active program.

**Inputs**

- Program (`program_id`, number, required): The program. It must be active. At least 1.
- Contact emails (`emails`, list): Email addresses of contacts to enrol, up to 25. Each must already be a contact.
- Lists (`list_ids`, list): Lists whose contacts to enrol, up to 10.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "addressBooks": [
      1
    ],
    "contacts": [
      1
    ],
    "dateCreated": "example",
    "id": "example",
    "programId": 1,
    "status": "example"
  }
}
```

### Get campaign

Get a campaign's name, subject, sender and status.

**Inputs**

- Campaign (`campaign_id`, number, required): The email campaign. At least 1.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "fromAddress": {
      "email": "example",
      "id": 1
    },
    "fromName": "example",
    "id": 1,
    "isSplitTest": true,
    "name": "example",
    "replyAction": "example",
    "replyToAddress": "example",
    "status": "example",
    "subject": "example"
  }
}
```

### Get campaign report

Get a sent campaign's totals: sends, deliveries, opens, clicks, unsubscribes, bounces and revenue.

**Inputs**

- Campaign (`campaign_id`, number, required): The email campaign. At least 1.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "dateSent": "example",
    "numOrders": 1,
    "numRecipientsClicked": 1,
    "numTotalClicks": 1,
    "numTotalDelivered": 1,
    "numTotalHardBounces": 1,
    "numTotalIspComplaints": 1,
    "numTotalSent": 1,
    "numTotalSoftBounces": 1,
    "numTotalUniqueOpens": 1,
    "numTotalUnsubscribes": 1,
    "percentageDelivered": 1,
    "percentageUniqueOpens": 1,
    "percentageUnsubscribes": 1,
    "percentageUsersClicked": 1,
    "revenue": "example"
  }
}
```

### Get campaign send status

Check on a send started with Send campaign.

**Inputs**

- Send ID (`send_id`, text, required): The send's ID, which Send campaign returns.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "campaignId": 1,
    "id": "example",
    "sendDate": "example",
    "status": "example"
  }
}
```

### Get contact

Get a contact by email address, mobile number or contact ID, with their data fields.

**Inputs**

- Find contact by (`find_by`, text): What the contact is looked up by. Leave empty for email address. One of: `email` (Email address), `mobileNumber` (Mobile number), `contactId` (Contact ID). Default: `email`.
- Contact (`contact`, text, required): The contact's email address, mobile number (in international format, such as 447700900184) or contact ID, matching Find contact by.
- Include (`include`, list): Extra details to return with each contact. One or more of: `channelProperties` (Channel subscriptions), `lists`, `preferences`, `consentRecords` (Consent records).

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "channelProperties": {
      "email": {
        "emailType": "example",
        "openTracking": "example",
        "optInType": "example",
        "status": "example"
      },
      "sms": {
        "countryCode": "example",
        "status": "example"
      }
    },
    "contactId": 1,
    "created": "example",
    "dataFields": {},
    "identifiers": {
      "email": "example",
      "mobileNumber": "example"
    },
    "lists": [
      {
        "id": 1,
        "name": "example",
        "status": "example"
      }
    ],
    "status": "example",
    "updated": "example"
  }
}
```

### Get list

Get a list's name, visibility and contact count.

**Inputs**

- List (`list_id`, number, required): The list (address book). At least 1.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "contacts": 1,
    "id": 1,
    "name": "example",
    "visibility": "example"
  }
}
```

### List campaigns

List email campaigns, optionally by status, type or send date.

**Inputs**

- Statuses (`statuses`, list): Only campaigns with these statuses. One or more of: `Unsent` (Not sent), `Sent`, `Sending`, `Paused`, `Cancelled`, `RequiresWorkflowApproval` (Waiting for approval).
- Type (`type`, text): Only standard or only triggered (transactional) campaigns. One of: `Standard`, `Triggered` (Triggered (transactional)).
- Sent since (`sent_since`, date): Only campaigns sent on or after this date.
- Records to return (`select`, number): How many records to return, up to 1000. Leave empty for 1000. From 1 to 1000.
- Records to skip (`skip`, number): How many records to skip, for reading the next page. Leave empty to start at the first record. At least 1.

**Outputs**

- `data` (list): The response from Dotdigital.

**Example output**

```json
{
  "data": [
    {
      "fromAddress": {
        "email": "example",
        "id": 1
      },
      "fromName": "example",
      "id": 1,
      "isSplitTest": true,
      "name": "example",
      "scheduledDate": "example",
      "sentDate": "example",
      "status": "example",
      "subject": "example",
      "tags": [
        "example"
      ],
      "type": "example"
    }
  ]
}
```

### List contacts

List contacts, oldest first, optionally only those in a list or segment, or created or changed since a time.

**Inputs**

- List (`list_id`, number): Only contacts in this list. At least 1.
- Segment (`segment_id`, number): Only contacts in this segment. At least 1.
- Created since (`created_since`, date and time): Only contacts created at or after this time.
- Changed since (`modified_since`, date and time): Only contacts changed at or after this time.
- Data fields (`data_fields`, list): Contact data fields to return, such as FIRSTNAME and LASTNAME, or [[ALL]] for every one.
- Include (`include`, list): Extra details to return with each contact. One or more of: `channelProperties` (Channel subscriptions), `lists`, `preferences`, `consentRecords` (Consent records).
- Contacts to return (`limit`, number): How many contacts to return, up to 5000. Leave empty for 1000. From 1 to 5000.
- Page marker (`marker`, text): The marker from the last page's next link, to read the next page.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "_items": [
      {
        "channelProperties": {
          "email": {
            "emailType": "example",
            "openTracking": "example",
            "optInType": "example",
            "status": "example"
          },
          "sms": {
            "countryCode": "example",
            "status": "example"
          }
        },
        "contactId": 1,
        "created": "example",
        "dataFields": {},
        "identifiers": {
          "email": "example",
          "mobileNumber": "example"
        },
        "lists": [
          {
            "id": 1,
            "name": "example",
            "status": "example"
          }
        ],
        "status": "example",
        "updated": "example"
      }
    ],
    "_links": {
      "next": {
        "link": "example",
        "marker": "example"
      }
    }
  }
}
```

### List contacts in list

List the contacts in a list or segment.

**Inputs**

- List (`list_id`, number, required): The list (address book). At least 1.
- Include data fields (`with_full_data`, true/false): Also return each contact's data fields.
- Records to return (`select`, number): How many records to return, up to 1000. Leave empty for 1000. From 1 to 1000.
- Records to skip (`skip`, number): How many records to skip, for reading the next page. Leave empty to start at the first record. At least 1.

**Outputs**

- `data` (list): The response from Dotdigital.

**Example output**

```json
{
  "data": [
    {
      "dataFields": [
        {
          "key": "example",
          "value": "example"
        }
      ],
      "email": "example",
      "emailType": "example",
      "id": 1,
      "optInType": "example",
      "status": "example"
    }
  ]
}
```

### List lists

List the account's lists (address books) with how many contacts each has.

**Inputs**

- Records to return (`select`, number): How many records to return, up to 1000. Leave empty for 1000. From 1 to 1000.
- Records to skip (`skip`, number): How many records to skip, for reading the next page. Leave empty to start at the first record. At least 1.

**Outputs**

- `data` (list): The response from Dotdigital.

**Example output**

```json
{
  "data": [
    {
      "contacts": 1,
      "id": 1,
      "name": "example",
      "visibility": "example"
    }
  ]
}
```

### List programs

List the account's automation programs and their status.

**Inputs**

- Records to return (`select`, number): How many records to return, up to 1000. Leave empty for 1000. From 1 to 1000.
- Records to skip (`skip`, number): How many records to skip, for reading the next page. Leave empty to start at the first record. At least 1.

**Outputs**

- `data` (list): The response from Dotdigital.

**Example output**

```json
{
  "data": [
    {
      "dateCreated": "example",
      "id": 1,
      "name": "example",
      "status": "example"
    }
  ]
}
```

### List segments

List the account's segments with how many contacts each has.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Dotdigital.

**Example output**

```json
{
  "data": [
    {
      "contacts": 1,
      "id": 1,
      "name": "example"
    }
  ]
}
```

### Remove contact from list

Take a contact out of a list. The contact stays in the account.

**Inputs**

- List (`list_id`, number, required): The list (address book). At least 1.
- Email (`email`, text, required): The contact's email address.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "contactId": 1,
    "listId": 1
  }
}
```

### Send campaign

Send a campaign to lists or segments, now or at a set time.

**Inputs**

- Campaign (`campaign_id`, number, required): The email campaign. At least 1.
- Lists (`list_ids`, list): Lists to send to.
- Segments (`segment_ids`, list): Segments to send to.
- Send at (`send_date`, date and time): When to send. Leave empty to send now.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "campaignId": 1,
    "id": "example",
    "sendDate": "example",
    "status": "example"
  }
}
```

### Send transactional email

Send a one-off email, such as a receipt, written here.

**Inputs**

- To (`to`, list, required): The email addresses to send to.
- Subject (`subject`, text, required): The subject line.
- HTML content (`html`, text): The email's HTML content.
- Plain text content (`text`, text): The email's plain text content.
- From address (`from_address`, text): The sender. It must be a from address set up in Dotdigital; leave empty for the account's default.
- CC (`cc`, list): Email addresses to copy in.
- BCC (`bcc`, list): Email addresses to blind copy.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "sent": true,
    "toAddresses": [
      "example"
    ]
  }
}
```

### Send triggered campaign

Send a triggered (transactional) campaign designed in Dotdigital, filling in its personalization values.

**Inputs**

- To (`to`, list, required): The email addresses to send to.
- Triggered campaign (`campaign_id`, number, required): The triggered campaign to send. At least 1.
- Personalization values (`personalization`, object): Values for the campaign's personalization placeholders, by placeholder name.
- From address (`from_address`, text): The sender. It must be a from address set up in Dotdigital; leave empty for the account's default.
- CC (`cc`, list): Email addresses to copy in.
- BCC (`bcc`, list): Email addresses to blind copy.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "sent": true,
    "toAddresses": [
      "example"
    ]
  }
}
```

### Unsubscribe contact from list

Unsubscribe a contact from one list, so they no longer get its campaigns.

**Inputs**

- List (`list_id`, number, required): The list (address book). At least 1.
- Email (`email`, text, required): The contact's email address.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "dateRemoved": "example",
    "reason": "example",
    "suppressedContact": {
      "dataFields": [
        {
          "key": "example",
          "value": "example"
        }
      ],
      "email": "example",
      "emailType": "example",
      "id": 1,
      "optInType": "example",
      "status": "example"
    }
  }
}
```

### Update list

Rename a list or change its visibility.

**Inputs**

- List (`list_id`, number, required): The list (address book). At least 1.
- Name (`name`, text, required): The list's name, up to 128 characters.
- Visibility (`visibility`, text): Public lists can be offered to contacts on preference pages. One of: `Private`, `Public`.

**Outputs**

- `data` (object): The response from Dotdigital.

**Example output**

```json
{
  "data": {
    "contacts": 1,
    "id": 1,
    "name": "example",
    "visibility": "example"
  }
}
```
