Push content from external sources

Overview

MailUp allows you to push content from an external source, in order to use it for triggering automatic campaigns or to simplify the message creation process. For example, in case of email messages. the pushed items will be available in the right pane of your Bee email editor, ready to be dragged into to your email message.

What is a content?

A content is a piece of information you want to quickly turn into messages, so that all stakeholders can be notified. It can be your latest blog post, the availability of a new product on your e-commerce site etc.

MailUp accepts objects that match a predefined format and makes them available for automated campaigns or as draggable items on the Bee editor. As a content provider, first you have to to map your information set into the MailUp fields that are designed for content management. Then you can push this content to MailUp using the web application or by means of the API methods described in this page.

 Click here to check the supported content fields ...

The Fields in bold are mandatory

FieldDescriptionFormat
Titlecontent titleString
Summarycontent short descriptionString
SubTitlecontent subtitleString
Imagelink of the image, hosted on your website, to be retrievedURL (full path)
LinkURLmain URL, where is the content itselfURL (full path)
LinkTexttext in the URLString
ContentDatepublishing date or a date you want to associate to the contentISO (e.g. "2018-08-14 11:27:23Z")
ContentKey

unique keyword to identify each content (it can be used to update an existing content or in the search bar in the page View contents)

String (e.g. a GUID)
Categorieslist of categories related to the contentArray of comma separated items
Authorslist of authorsArray of comma separated items

Why do I need to set a source for content pushed through API?

Automated campaigns are based on source updates, then you have to set a source for each content you push into MailUp. Even if you are not using automation, grouping by source is helpful when it comes to search or manage content using MailUp web application.

How can I build an automated campaign?

At the moment automated campaigns cannot be set using API. You need to use the MailUp web application. Please refer to Campaigns on the user guide

 

 

Table of Contents


Content sources

Add a new source

Description

Create a new source.

A source created using API is automatically visible on all MailUp lists and to all the users who have access to the Content area on the web application

HTTP Method

POST
URL
JSON request (example)

SourceName is the text displayed on the web application. It does not have to be unique and you can change it later

IsEnabled should be set to false if you want to avoid automatic campaigns to be triggered when this source is updated

{
	"SourceName": "mySource02",
	"IsEnabled": true
}
JSON response (example)

An error is returned if you set a null or empty SourceName.

Save the returned IdSource value to manage this source or to push content in it.

{
    "CreationDate": "2018-08-17 08:06:35Z",
    "IdSource": 902,
    "IsEnabled": true,
    "SourceName": "mySource02",
    "SourceType": 2,
    "UpdateDate": "2018-08-17 08:06:35Z"
}


Paging and filtering (example)

 

Get all available sources

DescriptionRead all the available sources
At the moment there is not a method to filter by source name. You need to retrieve a list of items and parse it

HTTP Method

GET
URL
JSON request (example)

none

JSON response (example)
 Click here to expand...

isEnabled = true means that this source can trigger an automated campaign

SourceType = 2 means that content can be pushed from files or API, while SourceType =1 means that content is pulled from an external URL (e.g. a RSS feed) .
The latter case can be managed only through the web application, not using MailUp API

{
 "IsPaginated": true,
 "Items": [
 {
 "CreationDate": "2018-08-17 08:06:35Z",
 "IdSource": 902,
 "IsEnabled": true,
 "SourceName": "mySource02",
 "SourceType": 2,
 "UpdateDate": "2018-08-17 08:06:35Z"
 },
 {
 "CreationDate": "2018-08-16 11:05:27Z",
 "IdSource": 901,
 "IsEnabled": true,
 "SourceName": "mySource01",
 "SourceType": 2,
 "UpdateDate": "2018-08-16 11:05:27Z"
 }
 ],
 "PageNumber": 0,
 "PageSize": 1000,
 "Skipped": 0,
 "TotalElementsCount": 2
}

 

 

Paging and filtering (example)

Pagination

GET /Console/ContentProvider/Sources?pageSize={max_items} to limit the number of returned items. Default value is 20.

GET /Console/ContentProvider/Sources?pageSize=1&pageNumber=0&orderby="UpdateDate ASC" to get the last modified item

Sorting

You can sort only by 'IdSource', 'UpdateDate', 'SourceName' (e.g. GET /Console/ContentProvider/Sources?orderby="idSource DESC" )


Update a source

DescriptionUpdate a source by changing its name or its status

HTTP Method

PUT
URL
JSON request (example)

It is recommended you specify only the fields you want to change. "SourceName" cannot be empty or whitespace.

{
  "IsEnabled": false
}
JSON response (example)

The modified item is returned

{
    "CreationDate": "2018-08-17 08:06:35Z",
    "IdSource": 902,
    "IsEnabled": false,
    "SourceName": "mySource02",
    "SourceType": 2,
    "UpdateDate": "2018-08-17 09:02:52Z"
}
Paging and filtering (example)

 


Remove a source

DescriptionDelete a source

HTTP Method

DELETE
URL
JSON request (example)

none

JSON response (example)

HTTP 200 and an empty body in case of success

HTTP 400 (Bad Request) is returned if the source to be deleted is linked to an automatic campaign.

When this occurs, you have remove all the campaigns related to this source (requires access to the web application)

Paging and filtering (example)

 


Content

Upload content

DescriptionUpload one or more content items

HTTP Method

POST
URL
JSON request (example)
 Click here to expand...

Use UploadMode = 2 (incremental).

Please note that "Items" is an array of comma separated values. With a single API call you can upload more content items. In case of bulk upload, any automated campaign related to the source is triggered once at the end of the whole data transfer.

ContentKey is a mandatory tag that informs MailUp if you are providing a new content or if you want to upload an existing one. You should handle it as a unique key.

Refer to the collapsed table on the top of this page for a list of all the supported tags.

{
	"UploadMode": 2,
	"Items": [{
		"ContentKey":"966ec9fd-d40b-47db-b4bb-d3be14bbc14b",
		"Image":"https://i.imgur.com/3Z5NaFI.jpg",
		"Authors":["Cicero","H. Rackham"],
		"LinkURL":"http://www.example.com",
		"LinkText":"This is an example",
		"Summary":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.",
		"Title":"Lorem ipsum",
		"Categories":["dummy","text"],
		"SubTitle":"Lorem ipsum dolor sit amet, consectetur adipiscing elit."
	}]
}

 

 
JSON response (example)

When successful, a task ID is returned. Please note that content upload is an asynchronous task, hence a successful response does not guarantee that the upload is completed, especially for large content lists.
If the request body contains just a few items, the upload is almost immediate. You could experience some delay when uploading hundreds or thousands of items

{
    "IdActivity": 713
}
Paging and filtering (example)

 


Get content list

DescriptionRetrieve a list of content items related to a source

HTTP Method

GET
URL
JSON request (example)

none

JSON response (example)
 Click here to expand...

In this case two items are returned for the specified source

{
    "IsPaginated": true,
    "Items": [
        {
            "Authors": [
                "Cicero",
                "H. Rackham"
            ],
            "Categories": [
                "dummy",
                "text"
            ],
            "ContentDate": "2018-08-17 07:41:14Z",
            "ContentKey": "966ec9fd-d40b-47db-b4bb-d3be14bbc14b",
            "CustomFields": [],
            "Image": "https://i.imgur.com/3Z5NaFI.jpg",
            "LinkText": "This is an example",
            "LinkURL": "http://www.example.com",
            "SubTitle": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
            "Summary": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.",
            "Title": "Lorem ipsum",
            "ContentLoadingDate": "2018-08-17 07:41:16Z"
        },
        {
            "Authors": [
                "author01",
                "author02"
            ],
            "Categories": [
                "cat01",
                "cat02"
            ],
            "ContentDate": "2018-08-17 07:25:21Z",
            "ContentKey": "d7a129eb-f31c-4480-a9dd-6313cf444d74",
            "CustomFields": [],
            "Image": "https://i.imgur.com/3Z5NaFI.jpg",
            "LinkText": "",
            "LinkURL": "",
            "SubTitle": "This is still a title but less important",
            "Summary": "Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.",
            "Title": "This is a title",
            "ContentLoadingDate": "2018-08-17 07:25:22Z"
        }
    ],
    "PageNumber": 0,
    "PageSize": 20,
    "Skipped": 0,
    "TotalElementsCount": 2
}

 

 

Paging and filtering (example)

Paging

Default page size is 20, page numbers start with zero (e.g. GET /Console/ContentProvider/Sources/{source_id}/Content?pageSize=100&pagenumber=0)

Sorting

You can sort only by 'ContentKey', 'ContentLoadingDate', 'ContentDate', 'Title' (e.g. GET /Console/ContentProvider/Sources/{source_id}/Content?orderBy="ContentDate DESC" )

Filtering

Search for items that match the provided input (e.g. GET /Console/ContentProvider/Sources/{source_id}/Content?searchBy="ContentKey"&searchText="1229c6d6" to get all the items whose ContentKey contains "1229c6d6"

Concatenated conditions

Use '&' to link together a series of conditions