Skip to main content
POST
/
v1
/
get_campaign
Get Campaign
curl --request POST \
  --url https://api.campaigncleaner.com/v1/get_campaign \
  --header 'Content-Type: application/json' \
  --data '
{
  "campaign": {
    "id": "{{campaign_id}}",
    "minimize_html": true
  }
}
'
import requests

url = "https://api.campaigncleaner.com/v1/get_campaign"

payload = { "campaign": {
"id": "{{campaign_id}}",
"minimize_html": True
} }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({campaign: {id: '{{campaign_id}}', minimize_html: true}})
};

fetch('https://api.campaigncleaner.com/v1/get_campaign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.campaigncleaner.com/v1/get_campaign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'campaign' => [
'id' => '{{campaign_id}}',
'minimize_html' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.campaigncleaner.com/v1/get_campaign"

payload := strings.NewReader("{\n \"campaign\": {\n \"id\": \"{{campaign_id}}\",\n \"minimize_html\": true\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.campaigncleaner.com/v1/get_campaign")
.header("Content-Type", "application/json")
.body("{\n \"campaign\": {\n \"id\": \"{{campaign_id}}\",\n \"minimize_html\": true\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.campaigncleaner.com/v1/get_campaign")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign\": {\n \"id\": \"{{campaign_id}}\",\n \"minimize_html\": true\n }\n}"

response = http.request(request)
puts response.read_body
{
  "campaign": {
    "adjust_font_colors": true,
    "adjust_font_size": false,
    "all_capitalized_words": 52,
    "all_capitalized_word_ratio": 7.14,
    "all_capitalized_word_max_acceptable_ratio": 10,
    "blacklisted_links_found": 0,
    "bg_images_found": 0,
    "broken_links_found": 2,
    "campaign_id": "8e754ce1-c2df-11ed-9848-003048d8d533",
    "campaign_name": "CC Postman Newsletter Analysis",
    "convert_h_to_p_tags": false,
    "convert_tables_to_divs": false,
    "custom_info": "",
    "header_tags_count": 19,
    "image_count": 13,
    "image_max_width": null,
    "images_missing_alt_attribute": 10,
    "links_missing_title_attribute": 5,
    "links_scanned": 36,
    "min_font_size_allowed": 10,
    "max_font_size_allowed": 32,
    "os_images_found": 6,
    "pd_cdns_found": 0,
    "pd_cdns_link_count": 0,
    "preserve_media_queries": true,
    "relative_links_base_url": null,
    "remove_inherited_css": true,
    "remove_classes_and_ids": true,
    "remove_control_non_printable": false,
    "remove_comments": true,
    "remove_image_height": true,
    "replace_non_ascii_characters": true,
    "remove_successive_punctuation": false,
    "results_time": "2023-03-14T23:14:26-04:00",
    "spam_keyword_ratio": 2.06,
    "spam_keyword_max_acceptable_ratio": 5,
    "spam_words_count": 15,
    "successive_exclaimations": 0,
    "successive_question_marks": 0,
    "successive_currency_marks": 0,
    "successive_periods": 0,
    "surrounding_div": {
      "max_width": 600,
      "text_align": "left",
      "font_size": 15,
      "center_to_parent": true
    },
    "text_image_ratio": 1.79,
    "text_image_max_acceptable_ratio": 10,
    "text_link_ratio": 1.79,
    "text_link_max_acceptable_ratio": 10,
    "total_word_count": 728,
    "campaign_html": "",
    "spam_keyword_list": [
      {
        "keyword": "Sign up",
        "count": 2
      },
      {
        "keyword": "Check",
        "count": 2
      },
      {
        "keyword": "Collect",
        "count": 2
      },
      {
        "keyword": "Offer",
        "count": 1
      },
      {
        "keyword": "Get paid",
        "count": 1
      },
      {
        "keyword": "Request",
        "count": 1
      },
      {
        "keyword": "Open",
        "count": 1
      },
      {
        "keyword": "Solution",
        "count": 1
      },
      {
        "keyword": "Subscribe",
        "count": 1
      },
      {
        "keyword": "Cure",
        "count": 1
      },
      {
        "keyword": "Now",
        "count": 1
      },
      {
        "keyword": "Privacy",
        "count": 1
      }
    ],
    "image_list": [
      {
        "image_url": "https://assets.getpostman.com/email/icon-github-color.png",
        "image_size": 1,
        "image_width": 24,
        "image_height": 24,
        "image_background": true
      },
      {
        "image_url": "https://assets.getpostman.com/email/icon-li-color.png",
        "image_size": 1,
        "image_width": 24,
        "image_height": 24,
        "image_background": true
      }
    ],
    "os_image_list": [
      {
        "image_url": "https://lp.postman.com/rs/067-UMD-991/images/Announcement-of-Ecosystem-Partner-Program%402x-100.jpg",
        "image_size": 62,
        "image_width": 1633,
        "image_height": 865,
        "image_background": true
      }
    ],
    "bg_image_list": [
      {
        "image_url": "https://assets.getpostman.com/email/icon-github-color.png",
        "image_size": 1,
        "image_width": 24,
        "image_height": 24,
        "image_background": true
      }
    ],
    "pd_cdn_list": [],
    "blacklisted_links": [],
    "domains_scanned": [
      "assets.getpostman.com",
      "blog.postman.com",
      "github.com"
    ],
    "broken_links": [
      {
        "link_url": "http://go.postman.com/track?mktoTestLink&mkt_tok=MDY3LVVNRC05OTEAAAGHHkyvUdX_2Si9w4zGTZVMU_omcKkgJ4IrP4unrXcDrM1bEcs_gl8jsqiMybmT6-mAwlcKRt_VgcT9Ou3nBO6XXYVo6GFMaUZwh7GiKHq8hB4",
        "link_status": "PNR Falure",
        "link_redirected_url": "",
        "link_is_image": false,
        "link_is_broken": true,
        "link_initial": false
      }
    ],
    "all_link_list": [
      {
        "link_url": "https://assets.getpostman.com/email/icon-github-color.png",
        "link_status": "206",
        "link_redirected_url": "",
        "link_is_image": false,
        "link_is_broken": false,
        "link_initial": true
      }
    ],
    "campaign_summary": [
      {
        "message": "CSS was inlined.",
        "count": 0,
        "html_changed": true,
        "apply_count": false
      },
      {
        "message": "spam keywords were found.",
        "count": 24,
        "html_changed": false,
        "apply_count": true
      }
    ]
  }
}

Headers

X-CC-API-Key
string

Body

application/json

The body is of type object.

Response

200 - application/json

OK

The response is of type object.