Advanced image processing and delivery through our global CDN with flexible storage options, intelligent compression, and multiple service types including Basic and CDN delivery modes.
This is the latest version of our Image CDN API with enhanced features including intelligent rate limiting, flexible duration options, and advanced image processing capabilities.
The CoreNexis Image CDN API V3 provides advanced image processing and delivery capabilities through our global content delivery network. This latest version introduces enhanced features including intelligent rate limiting, flexible duration options, and multiple service types.
All API requests require authentication using a client ID and API key. These credentials determine your access level, plan type, available service types, and usage limits.
For testing and development, you can use these sample credentials:
These are demo credentials with limited quotas for testing only. For production use, contact us to obtain your dedicated API credentials with full access.
Our API offers different plans and service types to meet various needs. Each plan provides different capabilities, storage durations, and access to service types.
Type | Description | Use Case | Availability |
---|---|---|---|
basic | Standard image processing and storage | General purpose image hosting, basic web applications | All plans |
cdn | Enhanced CDN delivery with optimized performance | High-traffic websites, professional applications | Trial & Paid plans only |
Feature | Free Plan | Trial Plan | Paid Plan |
---|---|---|---|
Rate Limit | 5 requests/minute | 10 requests/minute | 20+ requests/minute |
Daily Uploads | 20 images | 50 images | 100+ images |
Max File Size | 24MB | 24MB | 24MB |
Service Types | basic only | basic, cdn | basic, cdn |
Duration Options | 1H - 48H | 1H - 720H | 1H - 2160H, 0H |
Image Processing | β Available | β Available | β Available |
Permanent Storage (0H) | β Not available | β Not available | β Available |
Choose how long your images should be stored based on your plan:
Use format like 1H
, 24H
, 168H
(1 week), or 0H
for permanent storage. Decimal values like 0.5H
are not supported.
Our API implements intelligent rate limiting based on your plan and API configuration. Rate limits help ensure fair usage and optimal performance for all users.
Plan | Requests per Minute | Daily Upload Limit | Behavior on Limit |
---|---|---|---|
Free Plan | 2 requests | 20 uploads | 429 error with wait time |
Trial Plan | 5 requests | 50 uploads | 429 error with wait time |
Paid Plan | 10+ requests | 100+ uploads | 429 error with wait time |
When you hit rate limits, the API returns a 429 status with detailed information:
{
"success": false,
"message": "Rate limit exceeded. Please wait 14 seconds before making another request. Current limit: 5 requests per minute.",
"timestamp": "2025-07-05 05:49:05",
"api_version": "V3",
"error_code": "RATE_LIMIT_EXCEEDED"
}
Implement exponential backoff when receiving 429 errors. The response includes the exact wait time needed before your next request.
Upload and process images using either direct file upload or URL-based processing. Supports multiple service types, flexible storage durations, and advanced image processing options.
Parameter | Type | Description |
---|---|---|
client_id Required | String | Your client ID for authentication |
apikey Required | String | Your API key for authentication |
type Required | String |
Service type for processing:
|
duration Required | String |
Storage duration:
|
image Optional* | File | Image file to upload (Required if image_url not provided) |
image_url Optional* | String | URL of image to process (Required if image not provided) |
width Optional | Integer | Target width in pixels. Will only resize if target is smaller than original |
height Optional | Integer | Target height in pixels. Will only resize if target is smaller than original |
quality Optional | Integer | Compression quality 40-100. Lower = more compression. Default: 90 |
* Either image
or image_url
must be provided, but not both.
Successful requests return a 200 status with detailed processing information:
{
"success": true,
"message": "Image processed successfully",
"timestamp": "2025-07-05 05:47:06",
"api_version": "V3",
"data": {
"success_id": "rwij48&2H&p&c&i3n9.jpg",
"dimension": "800*533",
"compression_applied": true,
"compression_level": 80,
"width_apply": true,
"height_apply": true,
"plan": "paid",
"url": "https://cdn.corenexis.com/media/c/rwij48&2H&p&c&i3n9.jpg"
}
}
{
"success": true,
"message": "Image processed successfully",
"timestamp": "2025-07-05 05:50:39",
"api_version": "V3",
"data": {
"success_id": "z0peaf&1H&f&c&u0k9.jpg",
"dimension": "8192*5461",
"compression_applied": false,
"compression_level": 0,
"width_apply": false,
"height_apply": false,
"plan": "free",
"url": "https://cdn.corenexis.com/media/c/z0peaf&1H&f&c&u0k9.jpg"
}
}
Field | Description |
---|---|
success_id |
Unique identifier for the uploaded image |
dimension |
Final image dimensions in "width*height" format |
compression_applied |
Boolean indicating if compression was applied |
compression_level |
Quality level used (0 if no compression applied) |
width_apply |
Boolean indicating if width resizing was applied |
height_apply |
Boolean indicating if height resizing was applied |
plan |
Plan type used for processing (free/paid) |
url |
Direct CDN URL to access the processed image |
Our API provides intelligent image processing capabilities that automatically optimize your images while maintaining quality. All processing supports major image formats including JPEG, PNG, WebP, GIF, and more.
Smart resizing that only reduces image dimensions when the target size is smaller than the original. This prevents unnecessary quality loss from upscaling.
If you request 1200px width but the original is only 800px, the API will keep the original size to preserve quality. The response will show width_apply: false
.
curl -X POST \
-F "client_id=000003" \
-F "apikey=paid_plan_test_key_2024" \
-F "type=cdn" \
-F "duration=24H" \
-F "width=800" \
-F "height=600" \
-F "image=@/path/to/large-image.jpg" \
https://api.corenexis.com/image/cdn/V3
Advanced compression system that balances file size and quality. The quality parameter ranges from 40 (maximum compression) to 100 (best quality).
curl -X POST \
-F "client_id=000002" \
-F "apikey=trial_plan_test_key_2024" \
-F "type=basic" \
-F "duration=48H" \
-F "quality=70" \
-F "image_url=https://example.com/large-image.png" \
https://api.corenexis.com/image/cdn/V3
curl -X POST \
-F "client_id=000003" \
-F "apikey=paid_plan_test_key_2024" \
-F "type=cdn" \
-F "duration=0H" \
-F "width=1200" \
-F "height=800" \
-F "quality=80" \
-F "image=@/path/to/image.jpg" \
https://api.corenexis.com/image/cdn/V3
Integrate with our API using various programming languages and tools. Below are comprehensive examples showing different upload methods and processing options.
curl -X POST \
-F "client_id=000002" \
-F "apikey=trial_plan_test_key_2024" \
-F "type=basic" \
-F "duration=24H" \
-F "image=@/path/to/your/image.jpg" \
https://api.corenexis.com/image/cdn/V3
// File upload with JavaScript
document.getElementById('uploadForm').addEventListener('submit', async (e) => {
e.preventDefault();
const formData = new FormData();
formData.append('client_id', '000002');
formData.append('apikey', 'trial_plan_test_key_2024');
formData.append('type', 'cdn');
formData.append('duration', '168H'); // 1 week
// Get file from input element
const fileInput = document.getElementById('imageFile');
formData.append('image', fileInput.files[0]);
try {
const response = await fetch('https://api.corenexis.com/image/cdn/V3', {
method: 'POST',
body: formData
});
const data = await response.json();
console.log('Upload result:', data);
if (data.success) {
console.log('β
Upload successful!');
console.log('π Image URL:', data.data.url);
console.log('π Dimensions:', data.data.dimension);
console.log('ποΈ Compression applied:', data.data.compression_applied);
console.log('π Plan:', data.data.plan);
} else {
console.error('β Upload failed:', data.message);
}
} catch (error) {
console.error('π¨ Error:', error);
}
});
import requests
def upload_image(file_path, client_id, apikey, service_type, duration):
"""
Upload an image to CoreNexis CDN API V3
Args:
file_path (str): Path to the local image file
client_id (str): Your client ID
apikey (str): Your API key
service_type (str): 'basic' or 'cdn'
duration (str): Storage duration (e.g., '24H', '0H')
Returns:
dict: API response
"""
url = "https://api.corenexis.com/image/cdn/V3"
# Prepare form data
files = {
'image': open(file_path, 'rb')
}
data = {
'client_id': client_id,
'apikey': apikey,
'type': service_type,
'duration': duration
}
try:
# Make the request
response = requests.post(url, files=files, data=data)
if response.status_code == 200:
result = response.json()
if result['success']:
print(f"β
Upload successful!")
print(f"π Image URL: {result['data']['url']}")
print(f"π Dimensions: {result['data']['dimension']}")
print(f"ποΈ Compression: {result['data']['compression_applied']}")
print(f"π Plan: {result['data']['plan']}")
return result
else:
return {
'success': False,
'error': f"HTTP {response.status_code}",
'message': response.text
}
except Exception as e:
return {
'success': False,
'error': 'Request failed',
'message': str(e)
}
finally:
files['image'].close()
# Example usage
if __name__ == "__main__":
result = upload_image(
file_path="path/to/image.jpg",
client_id="000002",
apikey="trial_plan_test_key_2024",
service_type="cdn",
duration="72H"
)
if not result['success']:
print(f"β Upload failed: {result.get('message', 'Unknown error')}")
<?php
/**
* Upload an image to CoreNexis CDN API V3
*
* @param string $filePath Path to the local image file
* @param string $clientId Your client ID
* @param string $apikey Your API key
* @param string $type Service type ('basic' or 'cdn')
* @param string $duration Storage duration (e.g., '24H', '0H')
* @return array API response
*/
function uploadImage($filePath, $clientId, $apikey, $type, $duration) {
$url = "https://api.corenexis.com/image/cdn/V3";
// Initialize cURL session
$ch = curl_init();
// Prepare form data
$postFields = [
'client_id' => $clientId,
'apikey' => $apikey,
'type' => $type,
'duration' => $duration,
'image' => new CURLFile($filePath)
];
// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
// Execute the request
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Check for errors
if (curl_errno($ch)) {
$result = [
'success' => false,
'error' => 'cURL Error: ' . curl_error($ch)
];
} else if ($httpCode != 200) {
$result = [
'success' => false,
'error' => "HTTP {$httpCode}",
'message' => $response
];
} else {
$result = json_decode($response, true);
if ($result && $result['success']) {
echo "β
Upload successful!\n";
echo "π Image URL: {$result['data']['url']}\n";
echo "π Dimensions: {$result['data']['dimension']}\n";
echo "ποΈ Compression: " . ($result['data']['compression_applied'] ? 'Yes' : 'No') . "\n";
echo "π Plan: {$result['data']['plan']}\n";
}
}
// Close cURL session
curl_close($ch);
return $result;
}
// Example usage
$result = uploadImage(
'/path/to/image.jpg',
'000002',
'trial_plan_test_key_2024',
'cdn',
'48H'
);
if (!$result['success']) {
echo "β Upload failed: " . ($result['message'] ?? 'Unknown error') . "\n";
}
?>
curl -X POST \
-F "client_id=000003" \
-F "apikey=paid_plan_test_key_2024" \
-F "type=cdn" \
-F "duration=720H" \
-F "image_url=https://example.com/image.jpg" \
https://api.corenexis.com/image/cdn/V3
async function uploadImageFromUrl(imageUrl, clientId, apikey, type, duration) {
const formData = new FormData();
formData.append('client_id', clientId);
formData.append('apikey', apikey);
formData.append('type', type);
formData.append('duration', duration);
formData.append('image_url', imageUrl);
try {
const response = await fetch('https://api.corenexis.com/image/cdn/V3', {
method: 'POST',
body: formData
});
const result = await response.json();
if (result.success) {
console.log('β
URL upload successful!');
console.log('π CDN URL:', result.data.url);
console.log('π Dimensions:', result.data.dimension);
console.log('ποΈ Compression applied:', result.data.compression_applied);
console.log('β±οΈ API Version:', result.api_version);
} else {
console.error('β Upload failed:', result.message);
console.error('π¨ Error Code:', result.error_code);
}
return result;
} catch (error) {
console.error('π¨ Request error:', error);
return { success: false, error: error.message };
}
}
// Example usage
uploadImageFromUrl(
'https://example.com/large-image.jpg',
'000003',
'paid_plan_test_key_2024',
'cdn',
'0H' // Permanent storage
).then(result => {
console.log('Final result:', result);
});
import requests
def upload_image_from_url(image_url, client_id, apikey, service_type, duration):
"""
Upload an image from URL to CoreNexis CDN API V3
Args:
image_url (str): URL of the image to upload
client_id (str): Your client ID
apikey (str): Your API key
service_type (str): 'basic' or 'cdn'
duration (str): Storage duration
Returns:
dict: API response
"""
url = "https://api.corenexis.com/image/cdn/V3"
# Prepare form data
data = {
'client_id': client_id,
'apikey': apikey,
'type': service_type,
'duration': duration,
'image_url': image_url
}
try:
# Make the request
response = requests.post(url, data=data, timeout=30)
if response.status_code == 200:
result = response.json()
if result['success']:
print(f"β
URL upload successful!")
print(f"π CDN URL: {result['data']['url']}")
print(f"π Dimensions: {result['data']['dimension']}")
print(f"ποΈ Compression: {result['data']['compression_applied']}")
print(f"π Plan: {result['data']['plan']}")
print(f"β±οΈ Timestamp: {result['timestamp']}")
else:
print(f"β Upload failed: {result['message']}")
if 'error_code' in result:
print(f"π¨ Error Code: {result['error_code']}")
return result
else:
return {
'success': False,
'error': f"HTTP {response.status_code}",
'message': response.text
}
except requests.RequestException as e:
return {
'success': False,
'error': 'Request failed',
'message': str(e)
}
# Example usage
if __name__ == "__main__":
result = upload_image_from_url(
image_url="https://example.com/sample-image.png",
client_id="000002",
apikey="trial_plan_test_key_2024",
service_type="basic",
duration="168H" # 1 week
)
if not result['success']:
print(f"β Error: {result.get('message', 'Unknown error')}")
<?php
/**
* Upload an image from URL to CoreNexis CDN API V3
*
* @param string $imageUrl URL of the image to upload
* @param string $clientId Your client ID
* @param string $apikey Your API key
* @param string $type Service type ('basic' or 'cdn')
* @param string $duration Storage duration
* @return array API response
*/
function uploadImageFromUrl($imageUrl, $clientId, $apikey, $type, $duration) {
$url = "https://api.corenexis.com/image/cdn/V3";
// Initialize cURL session
$ch = curl_init();
// Prepare form data
$postFields = [
'client_id' => $clientId,
'apikey' => $apikey,
'type' => $type,
'duration' => $duration,
'image_url' => $imageUrl
];
// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// Execute the request
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Check for errors
if (curl_errno($ch)) {
$result = [
'success' => false,
'error' => 'cURL Error: ' . curl_error($ch)
];
} else if ($httpCode != 200) {
$result = [
'success' => false,
'error' => "HTTP {$httpCode}",
'message' => $response
];
} else {
$result = json_decode($response, true);
if ($result && $result['success']) {
echo "β
URL upload successful!\n";
echo "π CDN URL: {$result['data']['url']}\n";
echo "π Dimensions: {$result['data']['dimension']}\n";
echo "ποΈ Compression: " . ($result['data']['compression_applied'] ? 'Yes' : 'No') . "\n";
echo "π Plan: {$result['data']['plan']}\n";
echo "β±οΈ Timestamp: {$result['timestamp']}\n";
} else {
echo "β Upload failed: " . ($result['message'] ?? 'Unknown error') . "\n";
if (isset($result['error_code'])) {
echo "π¨ Error Code: {$result['error_code']}\n";
}
}
}
// Close cURL session
curl_close($ch);
return $result;
}
// Example usage
$result = uploadImageFromUrl(
'https://example.com/sample-image.jpg',
'000003',
'paid_plan_test_key_2024',
'cdn',
'0H' // Permanent storage
);
if (!$result['success']) {
echo "β Error: " . ($result['message'] ?? 'Unknown error') . "\n";
}
?>
# Resize + Compression + CDN delivery
curl -X POST \
-F "client_id=000003" \
-F "apikey=paid_plan_test_key_2024" \
-F "type=cdn" \
-F "duration=2160H" \
-F "width=1200" \
-F "height=800" \
-F "quality=75" \
-F "image=@/path/to/large-image.jpg" \
https://api.corenexis.com/image/cdn/V3
# High compression for thumbnails
curl -X POST \
-F "client_id=000002" \
-F "apikey=trial_plan_test_key_2024" \
-F "type=basic" \
-F "duration=24H" \
-F "width=300" \
-F "quality=50" \
-F "image_url=https://example.com/original.png" \
https://api.corenexis.com/image/cdn/V3
# Professional quality with minimal compression
curl -X POST \
-F "client_id=000003" \
-F "apikey=paid_plan_test_key_2024" \
-F "type=cdn" \
-F "duration=0H" \
-F "width=1920" \
-F "height=1080" \
-F "quality=95" \
-F "image=@/path/to/professional-photo.jpg" \
https://api.corenexis.com/image/cdn/V3
async function uploadWithAdvancedProcessing(file, options = {}) {
const formData = new FormData();
formData.append('client_id', options.clientId || '000003');
formData.append('apikey', options.apikey || 'paid_plan_test_key_2024');
formData.append('type', options.type || 'cdn');
formData.append('duration', options.duration || '168H');
formData.append('image', file);
// Add processing options
if (options.width) formData.append('width', options.width);
if (options.height) formData.append('height', options.height);
if (options.quality) formData.append('quality', options.quality);
try {
console.log('π Starting upload with processing...');
const response = await fetch('https://api.corenexis.com/image/cdn/V3', {
method: 'POST',
body: formData
});
const result = await response.json();
if (result.success) {
console.log('β
Upload and processing successful!');
console.log('π CDN URL:', result.data.url);
console.log('π Final dimensions:', result.data.dimension);
// Show processing details
const data = result.data;
console.log('π Processing Results:');
console.log(` π Width applied: ${data.width_apply ? 'Yes' : 'No'}`);
console.log(` π Height applied: ${data.height_apply ? 'Yes' : 'No'}`);
console.log(` ποΈ Compression applied: ${data.compression_applied ? 'Yes' : 'No'}`);
if (data.compression_applied) {
console.log(` ποΈ Quality level used: ${data.compression_level}`);
}
console.log(` π Plan: ${data.plan}`);
console.log(` π Success ID: ${data.success_id}`);
} else {
console.error('β Upload failed:', result.message);
if (result.error_code) {
console.error('π¨ Error Code:', result.error_code);
}
}
return result;
} catch (error) {
console.error('π¨ Request failed:', error);
return { success: false, error: error.message };
}
}
// Usage examples for different scenarios
document.getElementById('fileInput').addEventListener('change', async (e) => {
const file = e.target.files[0];
if (!file) return;
// Example 1: Web optimization
await uploadWithAdvancedProcessing(file, {
type: 'cdn',
duration: '720H',
width: 1200,
quality: 80
});
// Example 2: Thumbnail creation
await uploadWithAdvancedProcessing(file, {
type: 'basic',
duration: '24H',
width: 300,
height: 300,
quality: 60
});
// Example 3: High-quality permanent storage
await uploadWithAdvancedProcessing(file, {
type: 'cdn',
duration: '0H',
quality: 95
});
});
import requests
from typing import Optional
def upload_with_processing(
file_path: str,
client_id: str,
apikey: str,
service_type: str = 'cdn',
duration: str = '168H',
width: Optional[int] = None,
height: Optional[int] = None,
quality: Optional[int] = None
):
"""
Upload image with advanced processing options
Args:
file_path: Path to the image file
client_id: Your client ID
apikey: Your API key
service_type: 'basic' or 'cdn'
duration: Storage duration (e.g., '24H', '0H')
width: Target width for resizing
height: Target height for resizing
quality: Compression quality (40-100)
"""
url = "https://api.corenexis.com/image/cdn/V3"
files = {'image': open(file_path, 'rb')}
data = {
'client_id': client_id,
'apikey': apikey,
'type': service_type,
'duration': duration
}
# Add processing parameters if specified
if width: data['width'] = width
if height: data['height'] = height
if quality: data['quality'] = quality
try:
print(f"π Uploading {file_path} with processing...")
response = requests.post(url, files=files, data=data, timeout=30)
if response.status_code == 200:
result = response.json()
if result['success']:
data_obj = result['data']
print(f"β
Upload successful!")
print(f"π CDN URL: {data_obj['url']}")
print(f"π Final dimensions: {data_obj['dimension']}")
print(f"π Processing Results:")
print(f" π Width applied: {'Yes' if data_obj['width_apply'] else 'No'}")
print(f" π Height applied: {'Yes' if data_obj['height_apply'] else 'No'}")
print(f" ποΈ Compression applied: {'Yes' if data_obj['compression_applied'] else 'No'}")
if data_obj['compression_applied']:
print(f" ποΈ Quality level: {data_obj['compression_level']}")
print(f" π Plan: {data_obj['plan']}")
print(f" π Success ID: {data_obj['success_id']}")
print(f" β±οΈ Timestamp: {result['timestamp']}")
else:
print(f"β Upload failed: {result['message']}")
if 'error_code' in result:
print(f"π¨ Error Code: {result['error_code']}")
return result
else:
error_result = {
'success': False,
'error': f"HTTP {response.status_code}",
'message': response.text
}
print(f"β HTTP Error {response.status_code}")
return error_result
except Exception as e:
error_result = {
'success': False,
'error': 'Request failed',
'message': str(e)
}
print(f"π¨ Exception: {e}")
return error_result
finally:
files['image'].close()
# Example usage scenarios
if __name__ == "__main__":
# Scenario 1: Web optimization
print("=== Web Optimization ===")
upload_with_processing(
file_path="large_photo.jpg",
client_id="000003",
apikey="paid_plan_test_key_2024",
service_type="cdn",
duration="720H",
width=1200,
quality=80
)
print("\n=== Thumbnail Creation ===")
# Scenario 2: Thumbnail creation
upload_with_processing(
file_path="large_photo.jpg",
client_id="000002",
apikey="trial_plan_test_key_2024",
service_type="basic",
duration="48H",
width=300,
height=300,
quality=50
)
print("\n=== Professional Archive ===")
# Scenario 3: Professional quality permanent storage
upload_with_processing(
file_path="professional_photo.jpg",
client_id="000003",
apikey="paid_plan_test_key_2024",
service_type="cdn",
duration="0H", # Permanent
quality=95 # High quality
)
<?php
/**
* Upload image with advanced processing options
*/
function uploadWithProcessing($filePath, $clientId, $apikey, $options = []) {
$url = "https://api.corenexis.com/image/cdn/V3";
$ch = curl_init();
$postFields = [
'client_id' => $clientId,
'apikey' => $apikey,
'type' => $options['type'] ?? 'cdn',
'duration' => $options['duration'] ?? '168H',
'image' => new CURLFile($filePath)
];
// Add processing options
if (isset($options['width'])) $postFields['width'] = $options['width'];
if (isset($options['height'])) $postFields['height'] = $options['height'];
if (isset($options['quality'])) $postFields['quality'] = $options['quality'];
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
echo "π Uploading " . basename($filePath) . " with processing...\n";
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
$result = json_decode($response, true);
if ($result && $result['success']) {
$data = $result['data'];
echo "β
Upload successful!\n";
echo "π CDN URL: {$data['url']}\n";
echo "π Final dimensions: {$data['dimension']}\n";
echo "π Processing Results:\n";
echo " π Width applied: " . ($data['width_apply'] ? 'Yes' : 'No') . "\n";
echo " π Height applied: " . ($data['height_apply'] ? 'Yes' : 'No') . "\n";
echo " ποΈ Compression applied: " . ($data['compression_applied'] ? 'Yes' : 'No') . "\n";
if ($data['compression_applied']) {
echo " ποΈ Quality level: {$data['compression_level']}\n";
}
echo " π Plan: {$data['plan']}\n";
echo " π Success ID: {$data['success_id']}\n";
echo " β±οΈ Timestamp: {$result['timestamp']}\n";
} else {
echo "β Upload failed: " . ($result['message'] ?? 'Unknown error') . "\n";
if (isset($result['error_code'])) {
echo "π¨ Error Code: {$result['error_code']}\n";
}
}
return $result;
} else {
echo "β HTTP Error {$httpCode}\n";
return ['success' => false, 'error' => "HTTP {$httpCode}"];
}
}
// Example usage scenarios
echo "=== Web Optimization ===\n";
$result1 = uploadWithProcessing(
'/path/to/large-image.jpg',
'000003',
'paid_plan_test_key_2024',
[
'type' => 'cdn',
'duration' => '720H',
'width' => 1200,
'quality' => 80
]
);
echo "\n=== Thumbnail Creation ===\n";
$result2 = uploadWithProcessing(
'/path/to/large-image.jpg',
'000002',
'trial_plan_test_key_2024',
[
'type' => 'basic',
'duration' => '48H',
'width' => 300,
'height' => 300,
'quality' => 50
]
);
echo "\n=== Professional Archive ===\n";
$result3 = uploadWithProcessing(
'/path/to/professional-photo.jpg',
'000003',
'paid_plan_test_key_2024',
[
'type' => 'cdn',
'duration' => '0H', // Permanent storage
'quality' => 95 // High quality
]
);
?>
The API uses standard HTTP status codes and provides detailed error information to help you handle different scenarios effectively.
Status Code | Error Type | Example Response |
---|---|---|
400 | Missing Required Fields | {"success": false, "error_code": "MISSING_CLIENT_ID", "message": "Client ID is required"} |
400 | Invalid Duration Format | {"success": false, "error_code": "INVALID_DURATION_FORMAT", "message": "Invalid duration format. Use format like 1H, 2H, or 0H"} |
401 | Invalid API Key | {"success": false, "error_code": "INVALID_API_KEY", "message": "Invalid API key"} |
403 | Account Suspended | {"success": false, "error_code": "ACCOUNT_SUSPENDED", "message": "Account suspended: Payment overdue. Please contact support."} |
403 | API Not Enabled | {"success": false, "error_code": "API_NOT_ENABLED", "message": "Image CDN API not enabled. Please contact support or upgrade your plan."} |
403 | Type Not Allowed | {"success": false, "error_code": "TYPE_NOT_ALLOWED", "message": "CDN type not allowed. Please upgrade your plan."} |
403 | Duration Not Allowed | {"success": false, "error_code": "DURATION_NOT_ALLOWED", "message": "Maximum 48 hours allowed on your plan"} |
404 | Client Not Found | {"success": false, "error_code": "CLIENT_NOT_FOUND", "message": "Client not found"} |
429 | Rate Limit Exceeded | {"success": false, "error_code": "RATE_LIMIT_EXCEEDED", "message": "Rate limit exceeded. Please wait 14 seconds before making another request. Current limit: 5 requests per minute."} |
500 | Internal Server Error | {"success": false, "error_code": "INTERNAL_ERROR", "message": "Internal server error"} |
All error responses follow a consistent format for easy parsing:
{
"success": false,
"message": "Human-readable error message",
"timestamp": "2025-07-05 05:49:05",
"api_version": "V3",
"error_code": "MACHINE_READABLE_ERROR_CODE"
}
success
field before processing response data
error_code
for programmatic error handling
message
field to users for context
Test our API V3 quickly using Postman with these pre-configured examples. Postman makes it easy to test different scenarios and understand the API behavior.
Download our comprehensive Postman collection with all V3 endpoints and examples:
Download V3 Collectionhttps://api.corenexis.com/image/cdn/V3
client_id
: 000002
apikey
: trial_plan_test_key_2024
type
: basic
duration
: 24H
image
: [Select File] β Choose an imageclient_id
: 000003
apikey
: paid_plan_test_key_2024
type
: cdn
duration
: 720H
image_url
: https://example.com/large-image.jpg
width
: 800
quality
: 75
client_id
to see 404 errorapikey
to see 401 errortype=cdn
with free plan to see 403 error0.5H
to see validation errorNeed help with our API V3 or want to upgrade to a production plan with higher limits? We're here to assist you with integration and scaling.
Ready to use our API V3 in production? Get dedicated credentials with higher limits, priority support, and SLA guarantees.
Feature | Test/Demo | Production |
---|---|---|
Rate Limits | 5-20 req/min | Custom limits |
Daily Uploads | 100-1000 | Unlimited |
Storage | Limited duration | Flexible options |
Support | Community | Priority + SLA |
Analytics | Basic | Advanced reporting |
If you're using our previous API version, we provide free migration assistance to V3 with enhanced features and better performance. Contact us for a migration guide and support.