POST/api/v4/social/bulk-posts

Toplu gönderi oluşturma

Tek istekte en fazla 500 sosyal medya gönderisini doğrular ve kuyruğa alır; satır bazında sonuçlar için aralıklarla sorgulanacak bir iş döndürür.

API anahtarı gerektirir. Başlık biçimi ve anahtar yenileme için Kimlik doğrulama bölümüne bakın.

Parametreler

Gövde

Zorunlu olarak işaretlenen iç içe bir alan yalnızca üst alanını gönderdiğinizde geçerlidir. Üst alan isteğe bağlıysa ve onu göndermezseniz, zorunlu alt alanları da geçerli olmaz.

AdTürZorunluAçıklama
inputobjectzorunluWrapper object. The entire request body must be nested under `input`.
input.postsarray of objectszorunluThe rows to create, 1 to 500 of them. Each row is the same object POST /social/posts takes as its `input`; the per-row fields are listed below.
input.namestringisteğe bağlıOptional label for the job itself, to identify it in your own logs. Not shown to any audience.
input.posts[].socialProfileIdstringzorunluUUID of the brand publishing this row. Rows may target different brands in one request.
input.posts[].namestringzorunluInternal name for the post.
input.posts[].platformsarray of stringszorunluPlatforms for this row: `FACEBOOK`, `INSTAGRAM`, `TWITTER` (X), `LINKEDIN`, `PINTEREST`. Each must already have a connection on that row's brand.
input.posts[].contentstringzorunluThe post body.
input.posts[].actionstringzorunlu`DRAFT`, `SCHEDULE` (requires a schedule) or `PUBLISH`.
input.posts[].mediaUrlsarray of stringsisteğe bağlıPublic https image URLs. Required when the row targets Instagram or Pinterest.
input.posts[].videoUrlsarray of stringsisteğe bağlıPublic https video URLs.
input.posts[].linkstringisteğe bağlıLink to attach where the platform supports one.
input.posts[].scheduledAtstringisteğe bağlıISO-8601 publish instant with an offset. Alternative to `scheduleDate` + `scheduleTime`, never both.
input.posts[].scheduleDatestringisteğe bağlı`YYYY-MM-DD`, interpreted in that row's brand timezone. Send with `scheduleTime`.
input.posts[].scheduleTimestringisteğe bağlı`HH:MM`, interpreted in that row's brand timezone. Send with `scheduleDate`.
input.posts[].connectedChannelIdsarray of stringsisteğe bağlıRestrict this row to specific connections by ID.
input.posts[].clientReferencestringisteğe bağlıYour own identifier for this row, echoed back on the matching job result. The most reliable way to reconcile a batch against your own records.

Örnek istek

Yapıştırmaya hazır gövde. Yer tutucu kimlikleri ve değerleri kendi değerlerinizle değiştirin.

Request body
{  "input": {    "name": "Autumn campaign load",    "posts": [      {        "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",        "name": "Autumn week 1",        "platforms": ["INSTAGRAM", "FACEBOOK"],        "content": "Week one of the autumn collection: the Fairfield oak sideboard, finished by hand in the workshop.",        "mediaUrls": ["https://cdn.example.com/social/autumn-w1.jpg"],        "action": "SCHEDULE",        "scheduleDate": "2026-10-02",        "scheduleTime": "09:30",        "clientReference": "campaign-4471-slot-01"      },      {        "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",        "name": "Autumn week 2",        "platforms": ["INSTAGRAM", "FACEBOOK", "LINKEDIN"],        "content": "Week two: the Halcyon armchair. Sixty hours of work, one chair.",        "mediaUrls": ["https://cdn.example.com/social/autumn-w2.jpg"],        "action": "SCHEDULE",        "scheduleDate": "2026-10-09",        "scheduleTime": "09:30",        "clientReference": "campaign-4471-slot-02"      },      {        "socialProfileId": "a90f7c22-5db1-4e83-9f40-2b7c6a1e5d33",        "name": "Eastside autumn teaser",        "platforms": ["INSTAGRAM"],        "content": "Something solid is arriving next week. Stay tuned.",        "mediaUrls": ["https://cdn.example.com/social/eastside-teaser.jpg"],        "action": "SCHEDULE",        "scheduledAt": "2026-10-01T08:00:00-04:00",        "clientReference": "campaign-4471-slot-03"      }    ]  }}

Yanıtlar

200The whole batch validated. A job was queued, poll GET /social/bulk-posts/{bulkJobId} for per-row results.
Response
{  "data": {    "createBulkSocialMediaPosts": {      "success": true,      "error": [],      "job": {        "id": "9b3f18d0-7a26-4c51-8e94-1f0d5c6b7a82",        "status": "QUEUED",        "totalCount": 3,        "processedCount": 0,        "successCount": 0,        "failureCount": 0,        "createdAt": "2026-09-28T14:04:52Z",        "updatedAt": "2026-09-28T14:04:52Z",        "results": []      }    }  }}
200At least one row failed validation, so **nothing was created**. `success` is `false`, no job is returned, and each rejected row is reported with its 0-based `index`.
Response
{  "data": {    "createBulkSocialMediaPosts": {      "success": false,      "error": [        {          "message": "SY95050: Bulk validation failed, no posts were created",          "code": "SY95050",          "contextInfo": null        }      ],      "job": {        "id": null,        "status": "FAILED",        "totalCount": 3,        "processedCount": 0,        "successCount": 0,        "failureCount": 2,        "createdAt": "2026-09-28T14:04:52Z",        "updatedAt": "2026-09-28T14:04:52Z",        "results": [          {            "index": 1,            "clientReference": "campaign-4471-slot-02",            "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",            "platforms": ["INSTAGRAM", "FACEBOOK", "LINKEDIN"],            "status": "INVALID",            "socialPostId": null,            "postStatus": null,            "errors": [              {                "message": "SY95045: No connected channel for LINKEDIN on this brand",                "code": "SY95045",                "contextInfo": [{ "key": "platform", "value": "LINKEDIN" }]              }            ]          },          {            "index": 2,            "clientReference": "campaign-4471-slot-03",            "socialProfileId": "a90f7c22-5db1-4e83-9f40-2b7c6a1e5d33",            "platforms": ["INSTAGRAM"],            "status": "INVALID",            "socialPostId": null,            "postStatus": null,            "errors": [              {                "message": "SY95046: scheduledAt must carry a UTC offset",                "code": "SY95046",                "contextInfo": null              }            ]          }        ]      }    }  }}
401Unauthenticated, missing or invalid API key.

Tek bir istekte çok sayıda sosyal medya gönderisi oluşturur. Satırlar istek yükünde iletilir — dosya yükleme veya CSV yoktur; yalnızca POST /social/posts tarafından tek tek alınan nesnelerle aynı yapıdaki nesnelerden oluşan bir dizi vardır. Her istekte en fazla 500 satır gönderilebilir.

Kullanım senaryosu: bir çağrıda 3 aylık içerik yükleme. Planlama aracınızda müşterinin tüm içerik takvimi bulunur. Her zaman dilimi için bir satır oluşturun, her birini kendi clientReference değerinizle etiketleyin ve birlikte gönderin. Toplu işlem ya bir bütün olarak başarılı olur ya da tam olarak hangi satırları düzeltmeniz gerektiğini bildirir. Döndürülen job.id değerini saklayın ve status nihai bir duruma ulaşana kadar GET /social/bulk-posts/{bulkJobId} üzerinden düzenli aralıklarla sorgulama yapın, ardından her sonucu kendi clientReference değeriyle eşleştirin.

Toplu işlemin tamamı önceden doğrulanır

Herhangi bir şey oluşturulmadan önce tüm satırlar doğrulanır ve bu aşamada toplu işlem atomiktir:

  • Herhangi bir satır geçersizse hiçbir şey oluşturulmaz. success değeri false olur, SY95050 değeri error içinde döndürülür ve her hatalı satır, 0 tabanlı index değeri, clientReference değeri ve errors[] içindeki hata nedeni ile birlikte job.results[] içinde yer alır. Bu satırları düzeltin ve toplu işlemin tamamını yeniden gönderin.
  • Her satır geçerliyse bir iş kuyruğa alınır, success değeri true olur ve bir job.id alırsınız. Platform, satırları yayımlama sırasında reddederse tek tek satırlar daha sonra yine de başarısız olabilir; bu durum burada değil, iş üzerinde görünür.

Mümkün olduğunda clientReference değerine, aksi durumda index değerine göre eşleştirme yapın — satırların kendileri yanıtta geri döndürülmediğinden, kendi verilerinizle bağlantı kurmanızı sağlayan yalnızca bu 2 alandır.

Notlar.

  • İstek gövdesi, satırlar input.posts içinde olacak şekilde bir input nesnesiyle sarmalanmalıdır.
  • HTTP durumunu değil, success değerini kontrol edin. Toplu işlemin tamamının reddedilmesi, success: false ve error içinde SY95050 içeren bir HTTP 200 olarak döndürülür.
  • Her istekte en fazla 500 satır gönderilebilir. Daha büyük bir dizi SY95048 ile doğrudan reddedilir ve hiçbir şey oluşturulmaz; diziyi bölün ve birkaç toplu işlem halinde gönderin.
  • Her satırdaki marka socialProfileId ile belirtilir. brandId yalnızca bir URL yolu belirtecidir ve bu rotada hiçbir yol belirteci yoktur.
  • Satırlar farklı markaları hedefleyebilir. Her satırın platforms değerleri o satırın kendi markasına göre kontrol edilir; bu nedenle, bir markaya bağlı olup diğerine bağlı olmayan bir platform, yalnızca kendisine ihtiyaç duyan satırların başarısız olmasına neden olur.
  • Her satır, tek bir gönderiyle aynı zamanlama kurallarına uyar: scheduledAt veya scheduleDate + scheduleTime kullanılır, asla ikisi birden kullanılmaz ve scheduleDate / scheduleTime değerleri o satırın markasının saat diliminde yorumlanır. Bir toplu işlemde farklı satırlarda bu 2 biçimin birlikte kullanılması uygundur.
  • İstek hızı sınırları satırlara değil, isteğe uygulanır: 500 satırlık bir toplu işlem, kotanızdan bir istek tüketir. Bkz. İstek hızı sınırları.

Yazma işlemi: canlı hesapta yürütülmemiştir. Gösterilen istek ve yanıt, API şemasından oluşturulmuştur; bu işlem çalıştırıldığında gerçek sosyal medya hesaplarında yayın yapar.

Request
curl -X POST 'https://listingsapi.com/api/v4/social/bulk-posts' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "name": "Autumn campaign load",      "posts": [        {          "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",          "name": "Autumn week 1",          "platforms": [            "INSTAGRAM",            "FACEBOOK"          ],          "content": "Week one of the autumn collection: the Fairfield oak sideboard, finished by hand in the workshop.",          "mediaUrls": [            "https://cdn.example.com/social/autumn-w1.jpg"          ],          "action": "SCHEDULE",          "scheduleDate": "2026-10-02",          "scheduleTime": "09:30",          "clientReference": "campaign-4471-slot-01"        },        {          "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",          "name": "Autumn week 2",          "platforms": [            "INSTAGRAM",            "FACEBOOK",            "LINKEDIN"          ],          "content": "Week two: the Halcyon armchair. Sixty hours of work, one chair.",          "mediaUrls": [            "https://cdn.example.com/social/autumn-w2.jpg"          ],          "action": "SCHEDULE",          "scheduleDate": "2026-10-09",          "scheduleTime": "09:30",          "clientReference": "campaign-4471-slot-02"        },        {          "socialProfileId": "a90f7c22-5db1-4e83-9f40-2b7c6a1e5d33",          "name": "Eastside autumn teaser",          "platforms": [            "INSTAGRAM"          ],          "content": "Something solid is arriving next week. Stay tuned.",          "mediaUrls": [            "https://cdn.example.com/social/eastside-teaser.jpg"          ],          "action": "SCHEDULE",          "scheduledAt": "2026-10-01T08:00:00-04:00",          "clientReference": "campaign-4471-slot-03"        }      ]    }  }'