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.
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
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
Description | Read all the available sources |
---|---|
HTTP Method | GET |
URL | |
JSON request (example) | none |
JSON response (example) | 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) . {
"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
Description | Update 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
Description | Delete 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
Description | Upload one or more content items |
---|---|
HTTP Method | POST |
URL | |
JSON request (example) | 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. {
"IdActivity": 713
} |
Paging and filtering (example) |
|
Get content list
Description | Retrieve a list of content items related to a source |
---|---|
HTTP Method | GET |
URL | |
JSON request (example) | none |
JSON response (example) | 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 |