Node.js SDK
import Migma from 'migma';
const migma = new Migma('YOUR_API_KEY');
const { data, error } = await migma.validation.links({
html: '<html>...</html>'
});curl --request POST \
--url https://api.migma.ai/v1/emails/validate/links \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"timeout": 10000,
"followRedirects": true
}
'import requests
url = "https://api.migma.ai/v1/emails/validate/links"
payload = {
"html": "<string>",
"timeout": 10000,
"followRedirects": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.migma.ai/v1/emails/validate/links",
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([
'html' => '<string>',
'timeout' => 10000,
'followRedirects' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.migma.ai/v1/emails/validate/links"
payload := strings.NewReader("{\n \"html\": \"<string>\",\n \"timeout\": 10000,\n \"followRedirects\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.migma.ai/v1/emails/validate/links")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<string>\",\n \"timeout\": 10000,\n \"followRedirects\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.migma.ai/v1/emails/validate/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\n \"timeout\": 10000,\n \"followRedirects\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"totalLinks": 123,
"checkedLinks": [
{
"url": "<string>",
"type": "<string>",
"status": 123,
"statusText": "<string>",
"responseTime": 123,
"error": "<string>"
}
],
"summary": {
"workingLinks": 123,
"brokenLinks": 123,
"unreachableLinks": 123,
"averageResponseTime": 123
},
"recommendations": [
"<string>"
],
"metadata": {
"processingTime": 123,
"linksChecked": 123,
"linksSkipped": 123
}
}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}Analyze Email Links
Check all links in email HTML for validity and responsiveness. Identifies broken links, slow-loading resources, and unreachable URLs.
POST
/
v1
/
emails
/
validate
/
links
Node.js SDK
import Migma from 'migma';
const migma = new Migma('YOUR_API_KEY');
const { data, error } = await migma.validation.links({
html: '<html>...</html>'
});curl --request POST \
--url https://api.migma.ai/v1/emails/validate/links \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"timeout": 10000,
"followRedirects": true
}
'import requests
url = "https://api.migma.ai/v1/emails/validate/links"
payload = {
"html": "<string>",
"timeout": 10000,
"followRedirects": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.migma.ai/v1/emails/validate/links",
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([
'html' => '<string>',
'timeout' => 10000,
'followRedirects' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.migma.ai/v1/emails/validate/links"
payload := strings.NewReader("{\n \"html\": \"<string>\",\n \"timeout\": 10000,\n \"followRedirects\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.migma.ai/v1/emails/validate/links")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<string>\",\n \"timeout\": 10000,\n \"followRedirects\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.migma.ai/v1/emails/validate/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\n \"timeout\": 10000,\n \"followRedirects\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"totalLinks": 123,
"checkedLinks": [
{
"url": "<string>",
"type": "<string>",
"status": 123,
"statusText": "<string>",
"responseTime": 123,
"error": "<string>"
}
],
"summary": {
"workingLinks": 123,
"brokenLinks": 123,
"unreachableLinks": 123,
"averageResponseTime": 123
},
"recommendations": [
"<string>"
],
"metadata": {
"processingTime": 123,
"linksChecked": 123,
"linksSkipped": 123
}
}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}Authorizations
API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → Developers → API Keys.
Body
application/json
Was this page helpful?
⌘I