Mine Marketing API Documentation

Welcome to the Mine Marketing API documentation. Our APIs provide powerful tools for content syndication, campaign management, link building, and comprehensive reporting.

Available APIs

Content Submission API

Submit content for review in three ways:

  • Import - Provide a URL and we'll extract the content
  • Generate - Provide a topic and AI will create the content
  • Complete - Submit a fully-written HTML article

Base URL: https://api.minemarketing.tech/webhook/content

Campaigns Submission API

Submit advertising campaigns for compliance review. All ads must be submitted in paused status for review before activation.

Base URL: https://api.minemarketing.tech/webhook/campaign

Partners Syndication API

Access detailed AdSense reports and country-level analytics for your partner account.

Base URL: https://minemarketing.ai

RSOC Link Building API

Related Search on Content (RSOC) integration for tracking UTM parameters and routing traffic with flexible URLs.

Integration: https://articles.yourdomain.com/articles/{slug}/

Authentication

Content & Campaigns APIs

Both the Content Submission API and Campaigns Submission API use partner-specific headers for authentication. You'll receive:

Partner ID: Used as the header name
Token: Used as the header value
Applies to: Content API and Campaigns API
Example
Partner ID: partner_001
Token: abc123xyz789secrettoken456def
cURL - Content API
curl -X POST "https://api.minemarketing.tech/webhook/content" \
  -H "partner_001: abc123xyz789secrettoken456def" \
  -H "Content-Type: application/json"
cURL - Campaigns API
curl -X POST "https://api.minemarketing.tech/webhook/campaign" \
  -H "partner_001: abc123xyz789secrettoken456def" \
  -H "Content-Type: application/json"

Partners Syndication API

The Partners API uses Bearer token authentication:

cURL
curl -X GET "https://minemarketing.ai/partners/report" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Rate Limiting: The Partners API is limited to 2 requests per hour per endpoint.

Quick Start Guide

1. Get Your Credentials

Contact your account manager to receive your API credentials:

2. Make Your First Request

Content Submission Example

JavaScript
const submitContent = async () => {
  const response = await fetch('https://api.minemarketing.tech/webhook/content', {
    method: 'POST',
    headers: {
      'partner_001': 'your_token_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      content_type: 'generate',
      primary_topic: 'Best practices for remote team management',
      target_language: 'Hebrew'
    })
  });
  
  const data = await response.json();
  console.log(data);
};

Campaign Submission Example

JavaScript
const submitCampaign = async () => {
  const response = await fetch('https://api.minemarketing.tech/webhook/campaign', {
    method: 'POST',
    headers: {
      'partner_001': 'your_token_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      account_id: '123456789',
      adset_id: '112233445566'
    })
  });
  
  const data = await response.json();
  console.log('Campaign submitted for review:', data);
};

AdSense Report Example

JavaScript
const getReport = async () => {
  const response = await fetch('https://minemarketing.ai/partners/report?startDate=2025-01-01&endDate=2025-01-31', {
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN'
    }
  });
  
  const report = await response.json();
  console.log(report);
};

Submit Content

POST /content

Submit content for review and approval.

Content Types

1. Import from URL

Extract content from an existing article URL.

JSON
{
  "content_type": "import",
  "source_url": "https://example.com/my-article"
}

2. AI Generate

Generate content using AI based on a topic.

primary_topic REQUIRED
Must contain at least 4 words
target_language REQUIRED
Language for the generated content
JSON
{
  "content_type": "generate",
  "primary_topic": "Best practices for remote team management",
  "target_language": "Hebrew"
}

3. Complete Article

Submit a fully-written HTML article.

primary_topic REQUIRED
local_topic REQUIRED
target_language REQUIRED
category REQUIRED
One of: General, Health, Employment, Housing, Education, Finance, Vehicles, Telecom, Electronics, Travel, Pets, Services, Tech, Advertisement, Beauty, Shopping, Marketing
title REQUIRED
body REQUIRED
HTML content of the article
summary OPTIONAL
related_topics OPTIONAL
JSON
{
  "content_type": "complete",
  "primary_topic": "Cybersecurity Best Practices",
  "local_topic": "שיטות עבודה מומלצות באבטחת סייבר",
  "target_language": "Hebrew",
  "category": "Tech",
  "title": "10 Essential Cybersecurity Best Practices for 2025",
  "summary": "Protect your business with proven strategies",
  "body": "<h2>10 Essential Practices</h2><p>Content here...</p>",
  "related_topics": "password security, encryption, network security"
}

Check Content Status

GET /content

Retrieve your content submissions and check their status.

List All Submissions

cURL
curl -X GET "https://api.minemarketing.tech/webhook/content" \
  -H "partner_001: your_token_here"

Get Specific Submission

cURL
curl -X GET "https://api.minemarketing.tech/webhook/content?id=rec123456" \
  -H "partner_001: your_token_here"

Filter by Status

cURL
curl -X GET "https://api.minemarketing.tech/webhook/content?status=pending" \
  -H "partner_001: your_token_here"

Status Flow

Status Description Next Steps
pending Under review Check back later (~30 minutes)
approved Content approved Article is live, link provided
rejected Not approved See rejection_reason, fix, and resubmit
Reviews run hourly and typically complete in ~30 minutes. You'll be notified when status changes.

Code Examples

Python

Python
import requests
import json

API_URL = "https://api.minemarketing.tech/webhook/content"
HEADERS = {
    "partner_001": "your_token_here",
    "Content-Type": "application/json"
}

# Submit content
data = {
    "content_type": "generate",
    "primary_topic": "Best practices for remote team management",
    "target_language": "Hebrew"
}

response = requests.post(API_URL, headers=HEADERS, json=data)
result = response.json()
submission_id = result['data']['id']

print(f"Submission ID: {submission_id}")

# Check status
status_response = requests.get(
    f"{API_URL}?id={submission_id}", 
    headers=HEADERS
)
print(status_response.json())

Node.js

JavaScript
const axios = require('axios');

const API_URL = 'https://api.minemarketing.tech/webhook/content';
const HEADERS = {
    'partner_001': 'your_token_here',
    'Content-Type': 'application/json'
};

async function submitAndCheck() {
    try {
        // Submit content
        const payload = {
            content_type: 'generate',
            primary_topic: 'Best practices for remote team management',
            target_language: 'Hebrew'
        };
        
        const submitResponse = await axios.post(API_URL, payload, { headers: HEADERS });
        const submissionId = submitResponse.data.data.id;
        
        console.log(`Submission ID: ${submissionId}`);
        
        // Check status
        const statusResponse = await axios.get(
            `${API_URL}?id=${submissionId}`,
            { headers: HEADERS }
        );
        
        console.log('Status:', statusResponse.data);
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

submitAndCheck();

PHP

PHP
<?php
$apiUrl = 'https://api.minemarketing.tech/webhook/content';
$partnerId = 'partner_001';
$token = 'your_token_here';

$headers = [
    "$partnerId: $token",
    'Content-Type: application/json'
];

// Submit content
$data = [
    'content_type' => 'generate',
    'primary_topic' => 'Best practices for remote team management',
    'target_language' => 'Hebrew'
];

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$result = json_decode($response, true);
$submissionId = $result['data']['id'];

echo "Submission ID: $submissionId\n";

// Check status
$statusUrl = $apiUrl . '?id=' . $submissionId;
curl_setopt($ch, CURLOPT_URL, $statusUrl);
curl_setopt($ch, CURLOPT_HTTPGET, true);

$statusResponse = curl_exec($ch);
echo "Status: $statusResponse\n";

curl_close($ch);
?>

Campaigns Submission API

Important: All ads must be submitted in PAUSED status for compliance review. Do not activate ads before approval.
POST /campaign

Submit advertising campaigns for compliance review.

Base URL: https://api.minemarketing.tech/webhook/campaign

Authentication

This API uses the same authentication method as the Content Submission API. Use your Partner ID as the header name and your token as the value.

Headers
partner_001: your_token_here
Content-Type: application/json

Request Body

account_id REQUIRED
Your Facebook/Meta account ID
adset_id REQUIRED
The adset ID to submit for review

Submit Campaign for Review

cURL
curl -X POST "https://api.minemarketing.tech/webhook/campaign" \
  -H "partner_001: your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "123456789",
    "adset_id": "112233445566"
  }'

JavaScript Example

JavaScript
async function submitCampaignForReview(accountId, adsetId) {
    const response = await fetch('https://api.minemarketing.tech/webhook/campaign', {
        method: 'POST',
        headers: {
            'partner_001': 'your_token_here',
            'Content-Type': 'application/json'
        },
        body: JSON.stringify({
            account_id: accountId,
            adset_id: adsetId
        })
    });
    
    if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const result = await response.json();
    console.log('Campaign submitted:', result);
    return result;
}

// Example usage
submitCampaignForReview('123456789', '112233445566')
    .then(result => {
        console.log('Submission ID:', result.data.id);
    })
    .catch(error => {
        console.error('Error:', error);
    });

Python Example

Python
import requests
import json

def submit_campaign_for_review(account_id, adset_id):
    """Submit a campaign for compliance review"""
    
    url = "https://api.minemarketing.tech/webhook/campaign"
    headers = {
        "partner_001": "your_token_here",
        "Content-Type": "application/json"
    }
    
    data = {
        "account_id": account_id,
        "adset_id": adset_id
    }
    
    try:
        response = requests.post(url, headers=headers, json=data)
        response.raise_for_status()
        
        result = response.json()
        print(f"Campaign submitted successfully: {result}")
        return result
        
    except requests.exceptions.RequestException as e:
        print(f"Error submitting campaign: {e}")
        return None

# Example usage
if __name__ == "__main__":
    account_id = "123456789"
    adset_id = "112233445566"
    
    result = submit_campaign_for_review(account_id, adset_id)
    if result:
        print(f"Submission ID: {result.get('data', {}).get('id')}")

Compliance Requirements

Before Submission:
  • Ensure all ads in the adset are in PAUSED status
  • Review ad content for policy compliance
  • Verify targeting parameters are appropriate
  • Check that all creative assets are properly uploaded

Response Format

A successful submission will return a response with the submission ID and initial status:

JSON
{
    "status": "success",
    "data": {
        "id": "sub_abc123xyz",
        "account_id": "123456789",
        "adset_id": "112233445566",
        "status": "pending",
        "created_at": "2025-01-15T10:30:00Z"
    }
}

Campaign Compliance Status

GET /campaign

Check the compliance review status of your submitted campaigns.

List All Campaign Submissions

Retrieve all campaign submissions for your partner account.

cURL
curl -X GET "https://api.minemarketing.tech/webhook/campaign" \
  -H "partner_001: your_token_here"

Get Specific Campaign Status

Check the status of a specific campaign submission by adset ID.

cURL
curl -X GET "https://api.minemarketing.tech/webhook/campaign?adset_id=112233445566" \
  -H "partner_001: your_token_here"

Campaign Status Values

Status Description Action Required
pending Campaign is under review Wait for review completion (typically 1-2 hours)
approved Campaign passed compliance review Safe to activate ads in Facebook Ads Manager
disapproved Campaign failed compliance review Review the reason, fix issues, and resubmit

RSOC Link Building API

RSOC (Related Search on Content) lets you show relevant search results and reports on your pages and ads. Use it to track UTM parameters, route traffic with flexible URLs, and pull performance reports via dashboard or API.

What is RSOC?

RSOC is a comprehensive link building and tracking system that enables:

RSOC Integration Guide

Steps to Get Started

1. Custom Channels Setup

We set up approximately 150 custom channels to validate tracking. These channels help segment your traffic and ensure accurate attribution.

2. Pixel Tracking Configuration

Pass the pixel_id parameter to use your Facebook pixel. By default, we fire a Facebook Event for conversion tracking.

Example
pixel_id=1234567890123456

3. Reporting Access

Use the API endpoint to pull reports into your buying platform. Reports include:

  • Click-through rates by article
  • Conversion metrics by campaign
  • Performance by UTM parameters
  • Channel-specific analytics

4. Article Management

Send articles using our API. We can auto-generate content and return links per article with all tracking parameters pre-configured.

Implementation Examples

Basic Implementation

JavaScript
// Build RSOC tracking URL
function buildRSOCUrl(params) {
    const baseUrl = 'https://articles.yourdomain.com/articles';
    const {
        articleSlug,
        channelId,
        style = 'white', // default style
        fbEventName,
        pixelId,
        adAccountId,
        racContent,
        keywords,
        adsetId,
        campaignId,
        adId
    } = params;
    
    // Build URL with parameters
    const url = new URL(`${baseUrl}/${articleSlug}/`);
    
    // Add required parameters
    url.searchParams.append('channel', channelId);
    url.searchParams.append('st', style);
    url.searchParams.append('ts', 'fb');
    url.searchParams.append('event_name', fbEventName);
    url.searchParams.append('pixel_id', pixelId);
    url.searchParams.append('utm_source', adAccountId);
    url.searchParams.append('h', racContent);
    url.searchParams.append('terms', keywords.join(','));
    url.searchParams.append('utm_medium', adsetId);
    url.searchParams.append('utm_campaign', campaignId);
    url.searchParams.append('utm_content', adId);
    
    return url.toString();
}

// Example usage
const trackingUrl = buildRSOCUrl({
    articleSlug: 'best-practices-2025',
    channelId: 'CH_001',
    style: 'blue',
    fbEventName: 'ViewContent',
    pixelId: '1234567890123456',
    adAccountId: 'ACC_789',
    racContent: 'Discover Amazing Content',
    keywords: ['marketing', 'digital', 'seo'],
    adsetId: '{{adset.id}}',
    campaignId: '{{campaign.id}}',
    adId: '{{ad.id}}'
});

console.log(trackingUrl);

Facebook Ads Integration

Facebook URL Parameters
https://articles.yourdomain.com/articles/your-article/?channel=CH_001&st=white&ts=fb&event_name=ViewContent&pixel_id=1234567890&utm_source=ACC_123&h={{ad.name}}&terms=keyword1,keyword2&utm_medium={{adset.id}}&utm_campaign={{campaign.id}}&utm_content={{ad.id}}
RAC Requirement for Paid Traffic: The h parameter is mandatory for paid traffic. It must contain the ad headline and creative text to ensure proper tracking and attribution.

Best Practices

RSOC Parameters Reference

Mandatory Parameters

All fields listed below are mandatory except for the style parameter (which defaults to 'white').

article_slug REQUIRED
Unique identifier for the article. Used in the URL path.
channel REQUIRED
Channel ID for traffic segmentation and tracking validation.
ts REQUIRED
Traffic source identifier. Set to 'fb' for Facebook traffic.
event_name REQUIRED
Facebook conversion event name (e.g., ViewContent, Purchase, Lead).
pixel_id REQUIRED
Your Facebook pixel ID for conversion tracking.
utm_source REQUIRED
Ad Account ID for source attribution.
h REQUIRED (for paid traffic)
RAC content - must contain ad headline and creative text. Mandatory for paid traffic.
terms REQUIRED
Keywords separated by commas. Used for content relevance and search functionality.
utm_medium REQUIRED
Adset ID for medium attribution. Use {{adset.id}} in Facebook.
utm_campaign REQUIRED
Campaign ID for campaign attribution. Use {{campaign.id}} in Facebook.
utm_content REQUIRED
Ad ID for content attribution. Use {{ad.id}} in Facebook.

Optional Parameters

st OPTIONAL
Style parameter. Options: white (default), black, blue, green.

Parameter Examples

Complete URL with All Parameters

Full Example
https://articles.yourdomain.com/articles/seo-guide-2025/?
channel=CH_SEO_001&
st=blue&
ts=fb&
event_name=ViewContent&
pixel_id=1234567890123456&
utm_source=ACC_789456&
h=Ultimate%20SEO%20Guide%20for%202025&
terms=seo,marketing,digital,optimization&
utm_medium=ADSET_123&
utm_campaign=CAMP_456&
utm_content=AD_789

Minimal URL (with defaults)

Minimal Example
https://articles.yourdomain.com/articles/quick-tips/?
channel=CH_001&
ts=fb&
event_name=ViewContent&
pixel_id=1234567890&
utm_source=ACC_123&
h=Quick%20Tips&
terms=tips,guide&
utm_medium=ADSET_1&
utm_campaign=CAMP_1&
utm_content=AD_1

Facebook Dynamic Parameters

When setting up Facebook ads, use these dynamic parameters to automatically populate IDs:

Parameter Facebook Macro Description
utm_medium {{adset.id}} Automatically inserts the adset ID
utm_campaign {{campaign.id}} Automatically inserts the campaign ID
utm_content {{ad.id}} Automatically inserts the ad ID
h {{ad.name}} Can use ad name for RAC content

Validation Rules

Common Validation Errors:
  • Missing mandatory parameters will result in tracking failure
  • Invalid pixel_id format will prevent Facebook event firing
  • Empty or missing 'h' parameter for paid traffic will be rejected
  • Malformed UTM parameters will affect reporting accuracy
  • Invalid style parameter will default to 'white'

Testing Your Integration

  1. Build your URL with all required parameters
  2. Test the link in an incognito browser window
  3. Verify pixel firing using Facebook Pixel Helper
  4. Check parameter capture in your reporting dashboard
  5. Validate UTM tracking in Google Analytics or your analytics platform
  6. Confirm style rendering matches your selection
Pro Tip: Create a spreadsheet template with all your common parameter values to quickly generate RSOC URLs for different campaigns and articles.

RSOC Parameters Reference

Quick Start URL Structure

Here's the complete URL structure for RSOC integration:

URL Template
https://articles.yourdomain.com/articles/{article_slug}/?channel={channel_id}&st={style_name}&ts=fb&event_name={fb_conv_event_name}&pixel_id={pixel_id}&utm_source={ad_account_id}&h={rac_content}&terms={keywords}&utm_medium={{adset.id}}&utm_campaign={{campaign.id}}&utm_content={{ad.id}}

Complete Parameter List

All fields listed below are mandatory except for the style parameter.

article_slug REQUIRED
Unique identifier for the article. Used in the URL path.
channel REQUIRED
Channel ID for traffic segmentation and tracking validation.
ts REQUIRED
Traffic source identifier. Set to 'fb' for Facebook traffic.
event_name REQUIRED
Facebook conversion event name (e.g., ViewContent, Purchase, Lead).
pixel_id REQUIRED
Your Facebook pixel ID for conversion tracking.
utm_source REQUIRED
Ad Account ID for source attribution.
h REQUIRED (for paid traffic)
RAC content - must contain ad headline and creative text. Mandatory for paid traffic.
terms REQUIRED
Keywords separated by commas. Used for content relevance and search functionality.
utm_medium REQUIRED
Adset ID for medium attribution. Use {{adset.id}} in Facebook.
utm_campaign REQUIRED
Campaign ID for campaign attribution. Use {{campaign.id}} in Facebook.
utm_content REQUIRED
Ad ID for content attribution. Use {{ad.id}} in Facebook.
st OPTIONAL
Style parameter. Options: white (default), black, blue, green.

Style Options

Choose from four pre-designed styles for your RSOC implementation:

Style Name Parameter Value Description
White white Default clean white theme
Black black Dark theme for contrast
Blue blue Professional blue theme
Green green Fresh green theme

AdSense Reports

GET /partners/report

Retrieve AdSense reports for your partner account.

Rate Limit: 2 requests per hour

Request Parameters

startDate REQUIRED
Format: YYYY-MM-DD
endDate REQUIRED
Format: YYYY-MM-DD

Example Request

cURL
curl -X GET "https://minemarketing.ai/partners/report?startDate=2025-01-01&endDate=2025-01-31" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Country Breakdown Reports

GET /partners/report/country

Get country-level breakdown reports for your campaigns.

Rate Limit: 2 requests per hour

Request Parameters

startDate REQUIRED
Start date for the report (Format: YYYY-MM-DD)
endDate REQUIRED
End date for the report (Format: YYYY-MM-DD)

Example Request

cURL
curl -X GET "https://minemarketing.ai/partners/report/country?startDate=2025-01-01&endDate=2025-01-31" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Python Example

Python
import requests

def get_country_report(token, start_date, end_date):
    """Retrieve country breakdown report"""
    url = "https://minemarketing.ai/partners/report/country"
    headers = {
        "Authorization": f"Bearer {token}"
    }
    params = {
        "startDate": start_date,
        "endDate": end_date
    }
    
    response = requests.get(url, headers=headers, params=params)
    
    if response.status_code == 200:
        return response.json()
    else:
        raise Exception(f"API Error: {response.status_code} - {response.text}")

# Example usage
token = "YOUR_API_TOKEN"
start = "2025-01-01"
end = "2025-01-31"

try:
    report = get_country_report(token, start, end)
    print("Country Report:", report)
except Exception as e:
    print(f"Error: {e}")

JavaScript Example

JavaScript
async function getCountryReport(startDate, endDate) {
    const url = new URL('https://minemarketing.ai/partners/report/country');
    url.searchParams.append('startDate', startDate);
    url.searchParams.append('endDate', endDate);
    
    const response = await fetch(url, {
        headers: {
            'Authorization': 'Bearer YOUR_API_TOKEN'
        }
    });
    
    if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const report = await response.json();
    return report;
}

// Usage example
getCountryReport('2025-01-01', '2025-01-31')
    .then(report => console.log('Country Report:', report))
    .catch(error => console.error('Error:', error));

Error Handling

HTTP Status Codes

Code Description Common Causes
200 Success Request processed successfully
400 Bad Request Invalid parameters or missing required fields
401 Unauthorized Invalid or missing authentication credentials
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error - please try again later

Best Practices

General Guidelines

DO:
  • Store your API credentials securely
  • Implement proper error handling
  • Save submission IDs for tracking
  • Validate data locally before API calls
  • Use appropriate HTTP methods
DON'T:
  • Share your API credentials
  • Exceed rate limits
  • Make unnecessary API calls
  • Ignore error messages

Support & Resources

Getting Help

If you encounter issues with the API:

  1. Check error messages - They usually explain what's wrong
  2. Verify credentials - Ensure header name equals your Partner ID
  3. Review documentation - Check required fields and formats
  4. Test with examples - Use the provided code examples

Contact Information

Technical Support

For API issues and technical questions:

Email: support@minemarketing.ai

Account Management

For account issues and business inquiries:

Contact: Your assigned account manager