API Endpoints
Get Campaign
The get_campaign API allows you to retrieve any of your Saved Campaigns in Campaign Cleaner. The response below is a real example of a newsletter that “Postman” sent us, overall it’s a pretty good newsletter with a few issues, mainly image size and a couple of broken links.
Header:
X-CC-API-Key: Your API Key
Request Body:
Required: campaign:
- id: The campaign id that will be used in other API calls.
Optional: campaign:
- minimize_html: (true/false) If true (default), removes all whitespace, tabs, etc. Condensing the HTML.
Response:
campaign:
- adjust_font_colors: (true/false), If true, certain bright colors are spam triggers, like “red” or “#FF0000”, was adjusted to a slightly different color like “#FF0101”, it will look the same, but won’t trigger some spam filters.
- adjust_font_size: (true/false) If true, The min and max font size defined below in pixels were applied. If your newsletter contains larger or small font’s it was adjusted to the min/max you define.
- all_capitalized_word_ratio: (double) The ratio of all capitalized words to total words in your campaign.
- all_capitalized_words: (integer) The number of capitalized words found in your campaign.
- all_capitalized_word_max_acceptable_ratio: (double) The max acceptable ratio of all capitalize words to total words in your campaign.
- all_link_list: (list of links) All the links found in the campaign (images, text, etc.)
- link_url: (string) The URL or location of the broken link.
- link_status: (string) The status code of the link, please view the status guide below.
- link_redirected_url: (string) The location of where the link was redirected to, empty string, if it wasn’t redirected.
- link_is_image: (true/false) True, if the link is used as an image.
- link_is_broken: (true/false) True, if the link was non-functional at the time of the scan.
- link_initial: (true/false) True, if the link was the initial link in the campaign, not an intermediate or final link, if redirected.
- link_count: (integer) The number of times this link was found.
- link_secure: (true/false) true, if the link is HTTPS.
- link_tel: (true/false) true, if the link is tel:
- link_mailto: (true/false) tru, if the link is mailto:
- bg_images_found: (integer) The number of background images found, some major email clients don’t support background images.
- bg_image_list: (List of images) All the background images found
- image_url: (string) The URL of where the image is located.
- image_size (long) The size of the image in Kilobytes (KB)
- image_width: (integer) The width of the image.
- image_height: (integer) The height of the image.
- image_rendered_width: (integer) The rendered width of the image.
- image_rendered_height: (integer) The rendered height of the image.
- image_background: (true/false) Will always be true, since this is a background image.
- image_type: (Integer) 1=png, 2=jpeg, 3=gif, 4=bmp, 5=svg, 6=avif, 7=tif, 8=webp, 9=apng, 10=heic, 11=icon, 12=base64, -1=Unknown
- blacklisted_links: (list of blacklisted links) Links that are on blacklists and their properties.
- bl_url: (string) The web address where the blacklist is located.
- bl_name: (string) The name of the blacklist
- link_url: (string) The link in the campaign that is on a blacklist, can be a redirected link.
- blacklisted_links_found: (integer) The total number of blacklisted links found.
- broken_links: (list of links) All the broken links found in the campaign.
- link_url: (string) The URL or location of the broken link.
- link_status: (string) The reason why the link was considered broken, please view the status guide below.
- link_redirected_url: (string) The location of where the link was redirected to, empty string, if it wasn’t redirected.
- link_is_image: (true/false) true, if the link is used as an image.
- link_is_broken: (true/false) true, if the link was non-functional at the time of the scan.
- link_initial: (true/false) true, if the link was the initial link in the campaign, not an intermediate or final link, if redirected.
- link_count: (integer) The number of times this link was found.
- link_secure: (true/false) true, if the link is HTTPS.
- link_tel: (true/false) true, if the link is tel:
- link_mailto: (true/false) tru, if the link is mailto:
- campaign_id: The campaign id that will be used in other API calls.
- campaign_html: (string) The adjusted HTML of the campaign, with all the fixes that were selected.
- campaign_name: (string) The name the campaign was saved with.
- campaign_summary: (list of messages) A quick summary of some of the changes that were applied and some analysis highlights.
- apply_count: (true/false) If true, the count column apples to the message as the number of occurrences found. If false, the count will be zero, and the message is a statement of what happened.
- count: (integer) The total occurrences that was found or corrected.
- html_changed: (true/false) Indicates if the Campaign HTML was changed to correct the issue.
- message: (string) The change or analysis that took place that indicating something change or something should be looked into further.
- convert_h_to_p_tags: (true/false) If true, this will change all the H tags to P tags and set the correct font-size.
- convert_tables_to_divs: (true/false) - This is an experimental feature to convert all the tables to divs, in certain instances with a complicated table structure you might need to edit the HTML. We recommend leaving this as false or not setting it.
- custom_info: The values you passed us when calling the send_campaign API
- domains_scanned: (array of strings) The domains that were scanned at different blacklists.
- header_tags_count: (integer) The number of header tags found in the campaign, header tags displays are not consistent across email clients, use “div” or “p” tags styled correctly instead.
- host_extensionless_images: (true/false) If true, images without extensions will be hosted on our CDN when the resize_and_host parameter is set to true. Typically, dynamically generated images lack extensions, though there are exceptions.
- inline_css: (true/false) When set to true, CSS styles are directly applied within the style attribute of each HTML element.
- inline_css_important: (true/false) When set to true, the
!important
flag will also be inlined with CSS styles. If you are using media queries, it is generally recommended to keep this set to false. - media_queries_important: (true/false) When set to true, all media query styles will be marked with the
!important
flag. This ensures they can override any inline CSS without an!important
flag. - image_count: (integer) The total number of images found in your campaign including background images.
- image_max_width: (integer): The max-width style applied to all images in pixels.
- images_missing_alt_attribute: (integer) The number of images missing or have an empty “alt” attribute.
- image_list: (list of images) A list of all images found and their properties.
- image_url: (string) The URL of where the image is located.
- image_size (long) The size of the image in Kilobytes (KB)
- image_width: (integer) The width of the image.
- image_height: (integer) The height of the image.
- image_background: (true/false) True, if this is a background image, otherwise
- image_type: (Integer) 1=png, 2=jpeg, 3=gif, 4=bmp, 5=svg, 6=avif, 7=tif, 8=webp, 9=apng, 10=heic, 11=icon, 12=base64, -1=Unknown
- image_rendered_width: (integer) The rendered width of the image.
- image_rendered_height: (integer) The rendered height of the image.
- links_missing_title_attribute : (integer) The number of links missing the “title” attribute.
- links_scanned: (integer) The total number of links scanned, images, text, and redirects.
- os_images_found: (integer) The number of oversized images found in your campaign, slowing down the loading of your campaign.
- pd_cdn_list: (List of links on Poor delivery CDNs) Links that point to CDNs that are known to affect delivery.
- pd_cdn_name: (string) The name of the CDN that can affect delivery.
- pd_cdn_url: (string) The URL or Location the CDN uses to host content.
- min_font_size_allowed: (A positive Integer, under 100) in pixels.
- max_font_size_allowed: (A positive Integer under 100) in pixels.
- os_image_list:(list of images) All the oversized images in the campaign
- image_url: (string) The URL of where the image is located.
- image_size (long) The size of the image in Kilobytes (KB)
- image_width: (integer) The width of the image.
- image_height: (integer) The height of the image.
- image_background: (true/false) True, if this is a background image, otherwise false.
- image_type: (Integer) 1=png, 2=jpeg, 3=gif, 4=bmp, 5=svg, 6=avif, 7=tif, 8=webp, 9=apng, 10=heic, 11=icon, 12=base64, -1=Unknown
- image_rendered_width: (integer) The rendered width of the image.
- image_rendered_height: (integer) The rendered height of the image.
- pd_cdns_found: (integer) The number of content delivery networks found, known to cause adverse delivery issues.
- pd_cdns_link_count: (integer) The total number of links pointed to content delivery networks know to cause adverse delivery issues.
- preserve_media_queries: (true/false) True, if all media queries were preserved.
- relative_links_base_url: If set, this needs to be a full base URL like “https://campaigncleaner.com/”, if your email campaign has any relative paths, it will be converted to an absolute URL. In most instances, you won’t need to set this.
- remove_successive_punctuation: (true/false) if true, this will remove succession punctuation like …, !!!!, $$$ to a single occurrence.
- remove_css_inheritance: (true/false) If true, removes all elements of CSS that are inherited. Once CSS is inlined, the inherited CSS will be removed, for example if font-size of a parent tag is 15 pixels, there is no need for the font-size of the child tag to be specified as 15 pixels because it’s inherited or computed from the parent tag, this reduces the size of your HTML Campaign.
- remove_classes_and_ids: (true/false) If true, all the class and ID attributes after CSS Inlining was removed.
- remove_comments: (true/false) If true, comments were stripped from both CSS and HTML. Comments are invisible in HTML and can trigger spam filters.
- remove_control_non_printable: (true/false) If True, call non-printable and control characters are removed.
- remove_image_height: (true/false) if true, the height style was removed from all images, preventing any image distortions.
- remove_large_widths_over: (integer) Experimental: If sets removes all defined widths over the value set on non images and table tags.
- replace_diacritics: (true/false) If true, diacritic characters like á were replaced with a normal characters equivalent.
- replace_non_ascii_characters: (true/false) If true, all non-ascii characters were replaced with their ascii equivalent. For example, ❝ was replaced with ”. Non-ascii characters is of of the major spam trigger.
- resize_and_host: (true/false) If true, all eligible images were resized, converted, and hosted on our CDN. Read more about this here: Resize And Host
- spam_words_count: (integer) The total number of spam words found in your campaign.
- spam_keyword_list: (List of Spam Keywords) (keyword (string), count (integer) Array of all spam keywords found and the number of times they were found.
- keyword: The spam Keyword or phrase.
- count: The number of occurrences of the spam keyword.
- spam_keyword_ratio: (double) The spam keyword ratio of the campaign.
- spam_keyword_max_acceptable_ratio: (double) The max acceptable ratio for spam keywords for any campaign.
- successive_currency_marks: (integer) The number of successive currency marks found ”$$”.
- successive_exclaimations: (integer) The number of successive exclamation points found ”!!”.
- successive_question_marks: (integer) The number of successive question marks found ”??”.
- successive_periods: (integer) The number of successive periods found ”..”.
- surrounding_div: A surrounding “div” added to your html with the following styles added.
- max_width: The max-width style in pixels applied to the surrounding “div”.
- text_align: (left, center, right) All content within the surrounding “div” will be aligned according to the specified style. However, this can be over-written but setting “text-align” property on inner tags within the “div” to customize the appearance of your email.
- font_size: The pixel size that set in the surrounding div to adhere to, this adds an “!important” to all font-sizes that are set on any tag in the HTML to maintain the font you want. While setting all unspecified font sizes to the size you choose.
- center_to_parent: (true/false) If true, this will enable the surrounding “div” to be centered in any parent tags in which it is placed. This is particularly helpful when inserting an HTML snippet into a template
- text_link_max_acceptable_ratio: (double) the max acceptable text to link ratio for any campaign.
- text_link_ratio: (double) The text to link ratio of your campaign.
- text_image_max_acceptable_ratio: (double) the max acceptable text to image ratio for any campaign.
- text_image_ratio: (double) The text to image ratio of your campaign.
- total_word_count: (integer) The total number of words found in your campaign.
Additional Information:
HTTP Status Codes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In addition to status codes listed in the document above.
Status Code | Description |
---|---|
97 | Telephone Links start with tel: |
98 | Email links, starts with mailto: |
99 | Invalid URL - The provided website address is not valid. It may be a partial address, missing the necessary protocols (http or https), or has an incorrect format. |
POST
/
v1
/
get_campaign
Headers
Body
application/json · object
The body is of type object
.
Response
200 - application/json
The response is of type object
.