इसे छोड़कर कंटेंट पर जाएं

कंटेंट (Contents) API

कंटेंट (Contents) API सोशल मीडिया प्रकाशन कार्यों को बनाने, शेड्यूल करने, मीडिया अपलोड करने, निरीक्षण करने और रद्द करने के लिए एंडपॉइंट प्रदान करता है।


📌 एंडपॉइंट्स (Endpoints)

Section titled “📌 एंडपॉइंट्स (Endpoints)”
विधि (Method)पाथ (Path)विवरण (Description)आवश्यक स्कोप (Required Scope)
POST/v1/brand/contents/uploadsइमेज और वीडियो अपलोड के लिए प्री-साइन्ड (presigned) PUT URL उत्पन्न करेंpublishing:write या *
POST/v1/brand/contentsतत्काल या अनुसूचित पोस्ट सबमिट करें (202 Accepted)publishing:write या *
GET/v1/brand/contentsपेजिनेशन और स्थिति फ़िल्टर के साथ ब्रांड कंटेंट को सूचीबद्ध करेंpublishing:read या *
GET/v1/brand/contents/{content_id}कंटेंट विवरण और प्रकाशन जॉब का परिणाम प्राप्त करेंpublishing:read या *
POST/v1/brand/contents/{content_id}/cancelप्रोसेसिंग शुरू होने से पहले एक अनुसूचित पोस्ट को रद्द करेंpublishing:write या *

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_idstringआवश्यकलक्षित SNS कनेक्शन ID (कनेक्शंस API)
idempotency_keystringआवश्यकक्लाइंट द्वारा उत्पन्न अद्वितीय कुंजी जो डुप्लिकेट सबमिशन को रोकती है
textstringवैकल्पिकपोस्ट की बॉडी का टेक्स्ट
mediaarrayवैकल्पिकasset_ref के साथ मीडिया ऑब्जेक्ट्स की सूची
scheduled_forstringवैकल्पिकशेड्यूलिंग के लिए ISO 8601 टाइमस्टैम्प। तत्काल प्रकाशन के लिए खाली छोड़ दें
thread_postsarrayवैकल्पिकThreads वार्तालाप चेनिंग (chaining) के लिए अतिरिक्त पोस्ट
provider_settingsobjectवैकल्पिकप्लेटफॉर्म-विशिष्ट सेटिंग्स (जैसे, 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": [
{
"asset_ref": "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": "publishing",
"publish_job_id": "job_01jm8za2jobexample",
"scheduled_for": null,
"duplicate": false
}

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" \
-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. अनुसूचित पोस्ट को रद्द करें (POST /v1/brand/contents/{content_id}/cancel)

Section titled “4. अनुसूचित पोस्ट को रद्द करें (POST /v1/brand/contents/{content_id}/cancel)”

निष्पादन शुरू होने से पहले एक scheduled पोस्ट को रद्द करें।

टर्मिनल विंडो
curl -X POST "https://api.ankk.app/v1/brand/contents/content_01jm8za2example/cancel" \
-H "Authorization: Bearer spk_live_xxxxxxxx"

🔗 संबंधित दस्तावेज़

Section titled “🔗 संबंधित दस्तावेज़”