{
	"info": {
		"_postman_id": "8ed124bc-9b9a-4cfa-a945-19809deff061",
		"name": "Private CDN Suite API",
		"description": "Complete collection to test and interact with the Private CDN services (Image Processing, Mail Relay, and FFmpeg Video Converter).",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "1. Image Processing CDN",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{base_url}}/?service=image&url=https://www.w3schools.com/w3css/img_lights.jpg&w=400&h=300&fit=cover",
					"host": [
						"{{base_url}}"
					],
					"path": [
						""
					],
					"query": [
						{
							"key": "service",
							"value": "image",
							"description": "Routes the request to the Image processing CDN"
						},
						{
							"key": "url",
							"value": "https://www.w3schools.com/w3css/img_lights.jpg",
							"description": "The remote source image URL to process"
						},
						{
							"key": "w",
							"value": "400",
							"description": "Target width in pixels (optional)"
						},
						{
							"key": "h",
							"value": "300",
							"description": "Target height in pixels (optional)"
						},
						{
							"key": "fit",
							"value": "cover",
							"description": "Resizing fit mode: 'cover' (crop to fill), 'contain' (fit aspect ratio), or 'fill' (stretch)"
						}
					]
				},
				"description": "Downloads the specified remote image, resizes or crops it based on the fit parameter, converts it to WebP at 81% quality, caches the output, and streams it back directly."
			},
			"response": []
		},
		{
			"name": "2. Video Conversion CDN (JSON Details)",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{base_url}}/?service=video&url=https://www.w3schools.com/html/mov_bbb.mp4&w=640&json=true",
					"host": [
						"{{base_url}}"
					],
					"path": [
						""
					],
					"query": [
						{
							"key": "service",
							"value": "video",
							"description": "Routes the request to the Video conversion engine"
						},
						{
							"key": "url",
							"value": "https://www.w3schools.com/html/mov_bbb.mp4",
							"description": "The remote source video URL to convert"
						},
						{
							"key": "w",
							"value": "640",
							"description": "Target width to scale (optional, height is auto-scaled divisible by 2)"
						},
						{
							"key": "json",
							"value": "true",
							"description": "Tells the service to return JSON metadata instead of streaming the raw WebM binary"
						}
					]
				},
				"description": "Downloads the remote video, converts it to WebM format using FFmpeg (VP9/Opus), caches it, and returns the details of the cached file in JSON."
			},
			"response": []
		},
		{
			"name": "3. Video Conversion CDN (Direct Media Stream)",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{base_url}}/?service=video&url=https://www.w3schools.com/html/mov_bbb.mp4&w=640",
					"host": [
						"{{base_url}}"
					],
					"path": [
						""
					],
					"query": [
						{
							"key": "service",
							"value": "video",
							"description": "Routes the request to the Video conversion engine"
						},
						{
							"key": "url",
							"value": "https://www.w3schools.com/html/mov_bbb.mp4",
							"description": "The remote source video URL to convert"
						},
						{
							"key": "w",
							"value": "640",
							"description": "Target width to scale (optional)"
						}
					]
				},
				"description": "Streams the transcoded WebM video directly as a video/webm media stream (ideal for html5 video source tags)."
			},
			"response": []
		},
		{
			"name": "4. Mail Relay Service (POST)",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "X-API-Key",
						"value": "cdn_key_secret_123456",
						"type": "text",
						"description": "Authorized client API Key"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"api_key\": \"cdn_key_secret_123456\",\n    \"to\": \"admin@yourdomain.com\",\n    \"title\": \"Website Contact Form Submission\",\n    \"visitor_name\": \"John Doe\",\n    \"visitor_email\": \"johndoe@visitor.com\",\n    \"visitor_phone\": \"+1-555-0199\",\n    \"message\": \"Hello, this is a test submission. All custom keys will show up in the email table!\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/?service=mail",
					"host": [
						"{{base_url}}"
					],
					"path": [
						""
					],
					"query": [
						{
							"key": "service",
							"value": "mail",
							"description": "Routes the request to the Mail relay service"
						}
					]
				},
				"description": "Accepts form data or raw JSON, sanitizes target and sender fields, formats all other variables into a clean responsive HTML table, and forwards it to the recipient email via native php mail()."
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost:8888",
			"type": "string"
		}
	]
}
