{ "info": { "_postman_id": "zoneco-org-api-collection", "name": "Zoneco ORG API", "description": "Zoneco ORG API\n\nbase_url must be: https://zoneco.org/api\n\n1) Set admin_username and admin_password variables\n2) Run Admin Auth > POST Admin Login\n3) Token is saved to admin_token and shown in response body\n4) Admin requests send: Authorization: Token {{admin_token}}\n\nPermissions:\n- Public: create contact, mine contacts, view campaigns & compositions\n- Admin only: list all contacts, create/edit campaigns & compositions", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Admin Auth", "description": "ورود ادمین با username/password و دریافت توکن", "item": [ { "name": "POST Admin Login", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "if (pm.response.code === 200) {", " var json = pm.response.json();", " if (json.token) {", " pm.collectionVariables.set('admin_token', json.token);", " console.log('admin_token saved');", " }", "}" ] } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"username\": \"{{admin_username}}\",\n \"password\": \"{{admin_password}}\"\n}" }, "url": "{{base_url}}/admin/login/", "description": "Login. Response includes token. Also saved to collection variable admin_token." } }, { "name": "GET Admin Me (shows token works)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "GET", "header": [], "url": "{{base_url}}/admin/me/" } }, { "name": "POST Admin Logout", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "POST", "header": [], "url": "{{base_url}}/admin/logout/" } } ] }, { "name": "Contact Us", "description": "APIهای فرم تماس با ما", "item": [ { "name": "GET My Contact Us (Public)", "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/contact-us/mine/?email_or_phone={{my_email_or_phone}}", "host": [ "{{base_url}}" ], "path": [ "contact-us", "mine", "" ], "query": [ { "key": "email_or_phone", "value": "{{my_email_or_phone}}", "description": "Your email or phone used when submitting the form" } ] } } }, { "name": "GET All Contact Us (Admin)", "request": { "method": "GET", "header": [], "url": "{{base_url}}/contact-us/", "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] } } }, { "name": "GET Contact Us by ID", "request": { "method": "GET", "header": [], "url": "{{base_url}}/contact-us/1/" } }, { "name": "POST Create Contact Us", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"احمد محمدی\",\n \"email_or_phone\": \"ahmad@example.com\",\n \"description\": \"سلام، می‌خواستم در مورد خدمات شما اطلاعات بیشتری دریافت کنم.\",\n \"category\": \"پشتیبانی\"\n}" }, "url": "{{base_url}}/contact-us/" } }, { "name": "GET Contact Us by Category (Admin)", "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/contact-us/by_category/?category=پشتیبانی", "host": [ "{{base_url}}" ], "path": [ "contact-us", "by_category", "" ], "query": [ { "key": "category", "value": "پشتیبانی", "description": "همکاری | فروش | پشتیبانی | درخواست مشاور | سایر" } ] }, "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] } } }, { "name": "PATCH Update Contact Us (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "PATCH", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"admin_response\": \"پاسخ ادمین به پیام شما\"\n}" }, "url": "{{base_url}}/contact-us/1/" } }, { "name": "DELETE Contact Us (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "DELETE", "header": [], "url": "{{base_url}}/contact-us/1/" } } ] }, { "name": "Compositions", "description": "APIهای ترکیبات — پشتیبانی از آپلود چند تصویر با تصویر اصلی", "item": [ { "name": "GET All Compositions", "request": { "method": "GET", "header": [], "url": "{{base_url}}/compositions/" } }, { "name": "GET Composition by ID", "request": { "method": "GET", "header": [], "url": "{{base_url}}/compositions/{{composition_id}}/" } }, { "name": "GET Compositions by Created At", "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/compositions/by-created-at/?from=2026-01-01T00:00:00Z&to=2026-12-31T23:59:59Z", "host": [ "{{base_url}}" ], "path": [ "compositions", "by-created-at", "" ], "query": [ { "key": "from", "value": "2026-01-01T00:00:00Z", "description": "Start datetime — ISO 8601 (UTC). At least one of from/to required." }, { "key": "to", "value": "2026-12-31T23:59:59Z", "description": "End datetime — ISO 8601 (UTC). At least one of from/to required." } ] } } }, { "name": "POST Create Composition (JSON) (Admin)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"ترکیب تست\",\n \"description\": \"این یک ترکیب تستی است\"\n}" }, "url": "{{base_url}}/compositions/", "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] } } }, { "name": "POST Create Composition with Images (Admin)", "request": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "name", "value": "ترکیب با تصویر", "type": "text" }, { "key": "description", "value": "ترکیب با چند تصویر", "type": "text" }, { "key": "uploaded_images", "type": "file", "src": [] }, { "key": "uploaded_images", "type": "file", "src": [] }, { "key": "main_image_index", "value": "0", "type": "text", "description": "ایندکس تصویر اصلی (از 0)" } ] }, "url": "{{base_url}}/compositions/", "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] } } }, { "name": "POST Add Images to Composition (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "uploaded_images", "type": "file", "src": [] }, { "key": "main_image_index", "value": "0", "type": "text" } ] }, "url": "{{base_url}}/compositions/{{composition_id}}/add-images/" } }, { "name": "POST Set Main Image (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"image_id\": {{image_id}}\n}" }, "url": "{{base_url}}/compositions/{{composition_id}}/set-main-image/" } }, { "name": "DELETE Composition Image (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "DELETE", "header": [], "url": "{{base_url}}/compositions/{{composition_id}}/images/{{image_id}}/" } }, { "name": "PATCH Update Composition (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "PATCH", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"نام بروزرسانی شده\"\n}" }, "url": "{{base_url}}/compositions/{{composition_id}}/" } }, { "name": "DELETE Composition (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "DELETE", "header": [], "url": "{{base_url}}/compositions/{{composition_id}}/" } } ] }, { "name": "Campaigns", "description": "APIهای کمپین‌ها", "item": [ { "name": "GET All Campaigns", "request": { "method": "GET", "header": [], "url": "{{base_url}}/campaigns/" } }, { "name": "GET Campaign by ID", "request": { "method": "GET", "header": [], "url": "{{base_url}}/campaigns/1/" } }, { "name": "POST Create Campaign (Admin)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"کمپین تست\",\n \"description\": \"این یک کمپین تستی است\",\n \"start_time\": \"2026-06-01T00:00:00Z\",\n \"end_time\": \"2026-12-31T23:59:59Z\"\n}" }, "url": "{{base_url}}/campaigns/", "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] } } }, { "name": "POST Create Campaign with Image (Admin)", "request": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "name", "value": "کمپین با تصویر", "type": "text" }, { "key": "description", "value": "توضیحات کمپین", "type": "text" }, { "key": "start_time", "value": "2026-06-01T00:00:00Z", "type": "text" }, { "key": "end_time", "value": "2026-12-31T23:59:59Z", "type": "text" }, { "key": "image", "type": "file", "src": [] } ] }, "url": "{{base_url}}/campaigns/", "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] } } }, { "name": "GET Active Campaigns", "request": { "method": "GET", "header": [], "url": "{{base_url}}/campaigns/active/" } }, { "name": "GET Upcoming Campaigns", "request": { "method": "GET", "header": [], "url": "{{base_url}}/campaigns/upcoming/" } }, { "name": "GET Ended Campaigns", "request": { "method": "GET", "header": [], "url": "{{base_url}}/campaigns/ended/" } }, { "name": "PATCH Update Campaign (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "PATCH", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"نام بروزرسانی شده\"\n}" }, "url": "{{base_url}}/campaigns/1/" } }, { "name": "DELETE Campaign (Admin)", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "Authorization", "type": "string" }, { "key": "value", "value": "Token {{admin_token}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "method": "DELETE", "header": [], "url": "{{base_url}}/campaigns/1/" } } ] } ], "variable": [ { "key": "base_url", "value": "https://zoneco.org/api", "type": "string" }, { "key": "composition_id", "value": "1", "type": "string" }, { "key": "image_id", "value": "1", "type": "string" }, { "key": "admin_username", "value": "", "type": "string" }, { "key": "admin_password", "value": "", "type": "string" }, { "key": "admin_token", "value": "", "type": "string" }, { "key": "my_email_or_phone", "value": "ali@example.com", "type": "string" } ] }