कंटेंट (Contents) API
कंटेंट (Contents) API सोशल मीडिया प्रकाशन कार्यों को बनाने, शेड्यूल करने, मीडिया अपलोड करने, निरीक्षण करने और रद्द करने के लिए एंडपॉइंट प्रदान करता है।
📌 एंडपॉइंट्स (Endpoints)
Section titled “📌 एंडपॉइंट्स (Endpoints)”| विधि (Method) | पाथ (Path) | विवरण (Description) | आवश्यक स्कोप (Required Scope) |
|---|---|---|---|
POST | /v1/brand/contents/uploads | इमेज और वीडियो अपलोड के लिए प्री-साइन्ड (presigned) PUT URL उत्पन्न करें | publishing:create या * |
POST | /v1/brand/contents | तत्काल या अनुसूचित पोस्ट सबमिट करें (202 Accepted) | publishing:create या * |
GET | /v1/brand/contents | पेजिनेशन और स्थिति फ़िल्टर के साथ ब्रांड कंटेंट को सूचीबद्ध करें | publishing:read या * |
GET | /v1/brand/contents/{content_id} | कंटेंट विवरण और प्रकाशन जॉब का परिणाम प्राप्त करें | publishing:read या * |
DELETE | /v1/brand/contents/{content_id}/cancel | प्रोसेसिंग शुरू होने से पहले एक अनुसूचित पोस्ट को रद्द करें | publishing:delete या * |
1. मीडिया अपलोड प्री-साइन्ड URL (POST /v1/brand/contents/uploads)
Section titled “1. मीडिया अपलोड प्री-साइन्ड URL (POST /v1/brand/contents/uploads)”पोस्ट में मीडिया संलग्न करने के लिए, एक प्री-साइन्ड अपलोड URL का अनुरोध करें और HTTP PUT के माध्यम से बाइनरी को सीधे S3/R2 स्टोरेज में अपलोड करें।
समर्थित मीडिया प्रारूप (Supported Media Formats)
Section titled “समर्थित मीडिया प्रारूप (Supported Media Formats)”- इमेज (Images) (अधिकतम 20MB, URL समाप्ति 300s):
image/jpeg,image/png,image/webp,image/gif - वीडियो (Videos) (अधिकतम 500MB, URL समाप्ति 600s):
video/mp4,video/quicktime(.mov),video/webm
अनुरोध उदाहरण (Request Example)
Section titled “अनुरोध उदाहरण (Request Example)”curl -X POST "https://api.ankk.app/v1/brand/contents/uploads" \ -H "Authorization: Bearer spk_live_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "filename": "launch-banner.png", "content_type": "image/png", "size": 1420500 }'प्रतिक्रिया उदाहरण (Response Example) (200 OK)
Section titled “प्रतिक्रिया उदाहरण (Response Example) (200 OK)”{ "upload_url": "https://storage.ankk.app/sns-posts/original/brand_.../launch-banner.png?X-Amz-Signature=...", "asset_ref": "https://cdn.ankk.app/sns-posts/original/brand_.../launch-banner.png", "method": "PUT", "object_key": "sns-posts/original/brand_.../launch-banner.png", "content_type": "image/png", "size": 1420500, "expires_in_seconds": 300}PUT के माध्यम से बाइनरी अपलोड करें (Upload Binary via PUT)
Section titled “PUT के माध्यम से बाइनरी अपलोड करें (Upload Binary via PUT)”curl -X PUT "<upload_url>" \ -H "Content-Type: image/png" \ --data-binary "@/path/to/launch-banner.png"2. कंटेंट प्रकाशित करें (POST /v1/brand/contents)
Section titled “2. कंटेंट प्रकाशित करें (POST /v1/brand/contents)”प्रकाशन जॉब बनाने के लिए अपलोड किए गए asset_ref के साथ टेक्स्ट सबमिट करें।
अनुरोध बॉडी फ़ील्ड (Request Body Fields)
Section titled “अनुरोध बॉडी फ़ील्ड (Request Body Fields)”| फ़ील्ड | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
connection_id | string | आवश्यक | लक्षित SNS कनेक्शन ID (कनेक्शंस API) |
idempotency_key | string | आवश्यक | क्लाइंट द्वारा उत्पन्न अद्वितीय कुंजी जो डुप्लिकेट सबमिशन को रोकती है |
text | string | वैकल्पिक | पोस्ट की बॉडी का टेक्स्ट |
media | array | वैकल्पिक | url या asset_ref के साथ मीडिया ऑब्जेक्ट्स की सूची |
scheduled_for | string | वैकल्पिक | शेड्यूलिंग के लिए ISO 8601 टाइमस्टैम्प। तत्काल प्रकाशन के लिए खाली छोड़ दें |
thread_posts | array | वैकल्पिक | Threads वार्तालाप चेनिंग (chaining) के लिए अतिरिक्त पोस्ट |
provider_settings | object | वैकल्पिक | प्लेटफॉर्म-विशिष्ट सेटिंग्स (जैसे, YouTube श्रेणी) |
अनुरोध उदाहरण (तत्काल पोस्ट) (Request Example (Immediate Post))
Section titled “अनुरोध उदाहरण (तत्काल पोस्ट) (Request Example (Immediate Post))”curl -X POST "https://api.ankk.app/v1/brand/contents" \ -H "Authorization: Bearer spk_live_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "connection_id": "conn_01jm8x9k2example", "idempotency_key": "launch-2026-001", "text": "Excited to launch our new product today! 🚀\nhttps://ankk.app", "media": [ { "url": "https://cdn.ankk.app/sns-posts/original/brand_.../launch-banner.png" } ] }'प्रतिक्रिया उदाहरण (Response Example) (202 Accepted)
Section titled “प्रतिक्रिया उदाहरण (Response Example) (202 Accepted)”{ "content_id": "content_01jm8za2example", "status": "scheduled", "publish_job_id": "job_01jm8za2jobexample", "connection_id": "conn_01jm8x9k2example", "idempotency_key": "launch-2026-001"}3. कंटेंट को सूचीबद्ध और निरीक्षण करें
Section titled “3. कंटेंट को सूचीबद्ध और निरीक्षण करें”कंटेंट सूचीबद्ध करें (GET /v1/brand/contents)
Section titled “कंटेंट सूचीबद्ध करें (GET /v1/brand/contents)”curl -X GET "https://api.ankk.app/v1/brand/contents?status=published&limit=20" \ -H "Authorization: Bearer spk_live_xxxxxxxx"कंटेंट विवरण प्राप्त करें (GET /v1/brand/contents/{content_id})
Section titled “कंटेंट विवरण प्राप्त करें (GET /v1/brand/contents/{content_id})”curl -X GET "https://api.ankk.app/v1/brand/contents/content_01jm8za2example" \ -H "Authorization: Bearer spk_live_xxxxxxxx"4. अनुसूचित पोस्ट को रद्द करें (DELETE /v1/brand/contents/{content_id}/cancel)
Section titled “4. अनुसूचित पोस्ट को रद्द करें (DELETE /v1/brand/contents/{content_id}/cancel)”निष्पादन शुरू होने से पहले एक scheduled पोस्ट को रद्द करें।
curl -X DELETE "https://api.ankk.app/v1/brand/contents/content_01jm8za2example/cancel" \ -H "Authorization: Bearer spk_live_xxxxxxxx"