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:
Token: Used as the header value
Applies to: Content API and Campaigns API
Partner ID: partner_001
Token: abc123xyz789secrettoken456def
curl -X POST "https://api.minemarketing.tech/webhook/content" \
-H "partner_001: abc123xyz789secrettoken456def" \
-H "Content-Type: application/json"
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 -X GET "https://minemarketing.ai/partners/report" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Quick Start Guide
1. Get Your Credentials
Contact your account manager to receive your API credentials:
- For Content API: Partner ID and Token
- For Campaigns API: Partner ID and Token (same as Content API)
- For RSOC Integration: Custom channel IDs and tracking parameters
- For Partners API: Bearer Token
2. Make Your First Request
Content Submission Example
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
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
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
Submit content for review and approval.
Content Types
1. Import from URL
Extract content from an existing article URL.
{
"content_type": "import",
"source_url": "https://example.com/my-article"
}
2. AI Generate
Generate content using AI based on a topic.
{
"content_type": "generate",
"primary_topic": "Best practices for remote team management",
"target_language": "Hebrew"
}
3. Complete Article
Submit a fully-written HTML article.
{
"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
Retrieve your content submissions and check their status.
List All Submissions
curl -X GET "https://api.minemarketing.tech/webhook/content" \
-H "partner_001: your_token_here"
Get Specific Submission
curl -X GET "https://api.minemarketing.tech/webhook/content?id=rec123456" \
-H "partner_001: your_token_here"
Filter by Status
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 |
Code Examples
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
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
$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
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.
partner_001: your_token_here
Content-Type: application/json
Request Body
Submit Campaign for Review
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
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
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
- 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:
{
"status": "success",
"data": {
"id": "sub_abc123xyz",
"account_id": "123456789",
"adset_id": "112233445566",
"status": "pending",
"created_at": "2025-01-15T10:30:00Z"
}
}
Campaign Compliance Status
Check the compliance review status of your submitted campaigns.
List All Campaign Submissions
Retrieve all campaign submissions for your partner account.
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 -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
What is RSOC?
RSOC is a comprehensive link building and tracking system that enables:
- Granular Tracking: Monitor performance at the article and keyword level
- UTM Parameter Collection: Capture campaign, source, medium, and content data
- Flexible Routing: Direct traffic with customizable URLs
- Performance Reporting: Access detailed analytics via API or dashboard
- Content Generation: Auto-generate articles and receive tracking links
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.
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
// 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
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}}
h parameter is mandatory for paid traffic. It must contain the ad headline and creative text to ensure proper tracking and attribution.
Best Practices
- Always include all mandatory parameters - Missing parameters will result in incomplete tracking
- Use descriptive channel IDs - This helps with reporting and analysis
- Encode special characters - URL encode the RAC content and keywords
- Test tracking before launch - Verify all parameters are being captured correctly
- Use consistent naming conventions - This simplifies reporting and analysis
RSOC Parameters Reference
Mandatory Parameters
All fields listed below are mandatory except for the style parameter (which defaults to 'white').
Optional Parameters
Parameter Examples
Complete URL with All Parameters
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)
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
- 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
- Build your URL with all required parameters
- Test the link in an incognito browser window
- Verify pixel firing using Facebook Pixel Helper
- Check parameter capture in your reporting dashboard
- Validate UTM tracking in Google Analytics or your analytics platform
- Confirm style rendering matches your selection
RSOC Parameters Reference
Quick Start URL Structure
Here's the complete URL structure for RSOC integration:
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.
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
Retrieve AdSense reports for your partner account.
Request Parameters
Example Request
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 country-level breakdown reports for your campaigns.
Request Parameters
Example Request
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
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
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
- Store your API credentials securely
- Implement proper error handling
- Save submission IDs for tracking
- Validate data locally before API calls
- Use appropriate HTTP methods
- 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:
- Check error messages - They usually explain what's wrong
- Verify credentials - Ensure header name equals your Partner ID
- Review documentation - Check required fields and formats
- 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