POST/api/v4/bulk-posts

Toplu gönderi oluşturun

Tek bir sosyal medya gönderisi oluşturur ve tek bir istekte birden fazla konumda yayımlar.

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. Every field below is a property of `input`, the entire body must be nested under it.
input.postNamestringzorunluInternal name for the campaign (not shown publicly).
input.locationIdsarray of stringszorunluBase64-encoded location Relay IDs to publish to.
input.postTypestringzorunluOne of `EVENT`, `OFFER`, `ANNOUNCEMENT`, `COVID19`, `PRODUCT`.
input.postSitesarray of stringszorunluTarget publishers: `GOOGLE` and/or `FACEBOOK`.
input.postMessagearray of objectsisteğe bağlıPer-site post body. Each entry: `site` and `message`.
input.postMessage[].sitestringzorunluPublisher for this message: `GOOGLE` or `FACEBOOK`.
input.postMessage[].messagestringzorunluPost body text for that site.
input.postMediaUrlarray of objectsisteğe bağlıPer-site media. Each entry: `site`, `url`, and `type` (`IMAGE` or `VIDEO`).
input.postMediaUrl[].sitestringzorunluPublisher for this media asset.
input.postMediaUrl[].urlstringzorunluPublicly accessible media URL.
input.postMediaUrl[].typestringisteğe bağlı`IMAGE` or `VIDEO`.
input.postCtaarray of objectsisteğe bağlıPer-site call-to-action button. Each entry: `site`, `type`, `url`.
input.postScheduledDatesobjectisteğe bağlıScheduling window: `startDatetime`, `endDatetime`, and optional `removalSites`. When provided, the post is created with status `SCHEDULED`.
input.postScheduledDates.startDatetimestringzorunluISO-8601 datetime the post goes live.
input.postScheduledDates.endDatetimestringzorunluISO-8601 datetime the post is removed.
input.postContextInfoobjectisteğe bağlıType-specific details (offer coupon/redeem/terms, or event title/times). Required by `OFFER`, `EVENT`, and `PRODUCT` posts.
input.productsarray of objectsisteğe bağlıProduct entries for `PRODUCT` posts (name, price, photo, cta).
input.componentIdentifierstringisteğe bağlıOptional client component reference for tracking.
input.componentTypestringisteğe bağlıOptional client component type for tracking.

Örnek istek

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

Request body
{  "input": {    "postName": "July Reopening Announcement",    "locationIds": [      "TG9jYXRpb246MTgwMDI4OQ==",      "TG9jYXRpb246MTgwMDI5MA=="    ],    "postType": "ANNOUNCEMENT",    "postSites": ["GOOGLE", "FACEBOOK"],    "postMessage": [      { "site": "GOOGLE", "message": "We're back! Visit us this week for our summer menu." },      { "site": "FACEBOOK", "message": "We're back! Swing by for the new summer menu." }    ],    "postMediaUrl": [      { "site": "GOOGLE", "url": "https://cdn.example.com/summer.jpg", "type": "IMAGE" }    ],    "postScheduledDates": {      "startDatetime": "2026-07-10T09:00:00Z",      "endDatetime": "2026-07-24T23:59:00Z"    }  }}

Yanıtlar

200Bulk post accepted. `success` is true and the created campaign is returned. Note the response is keyed under `createSocialPost`: the bulk endpoint returns the same response shape as `POST /posts`.
Response
{  "data": {    "createSocialPost": {      "clientMutationId": null,      "success": true,      "errors": null,      "socialPost": {        "id": "U29jaWFsUG9zdDo5OTIwMQ==",        "name": "July Reopening Announcement",        "status": "SCHEDULED",        "type": "ANNOUNCEMENT",        "createdAt": "2026-07-08",        "scheduledStartDate": "2026-07-10",        "scheduledEndDate": "2026-07-24",        "sites": ["GOOGLE", "FACEBOOK"],        "locationIds": [1800289, 1800290]      }    }  }}
400Bad request, the body was not wrapped in `input` (error message: `Variable "$input" of required type ... was not provided`).
401Unauthenticated, missing or invalid API key.

Tek bir gönderi kampanyası oluşturur ve bunu locationIds içindeki her konuma dağıtarak seçilen postSites üzerinde yayımlar. Konum başına oluşturma işleminin aksine, tek bir çağrı tüm konumlarınızı hedefler; bu, şirket genelinde bir duyuru, teklif veya etkinlik yürütmenin verimli bir yoludur.

İstek yapısı. Gövdenin tamamı bir input nesnesi içine alınmalıdır; her alan (postName, locationIds, postType, …), input nesnesinin bir özelliğidir. Bir nesne içine alınmamış düz bir gövde, HTTP 400 (Variable "$input" of required type ... was not provided) ile reddedilir. Bu, POST /posts ile aynı sözleşmedir ve başarılı bir yanıt, toplu işleme özgü bir anahtar yerine createSocialPost anahtarı altında yer alır.

Kullanım senaryosu: şirket genelinde duyuru (yukarıda gösterilmiştir). postType: "ANNOUNCEMENT" değerini ayarlayın, konum kimliklerini listeleyin ve her konum için bir postMessage sağlayın. Gönderiyi belirli bir zaman aralığında yayımlamak için postScheduledDates ekleyin (bu durumda gönderi SCHEDULED durumuyla oluşturulur); hemen yayımlamak için bunu eklemeyin.

Kullanım senaryosu: tüm mağazalarda sınırlı süreli bir teklif. postType değerini OFFER olarak değiştirin ve kuponu postContextInfo içinde sağlayın (yine input içine alınmış olarak):

JSON
{  "input": {    "postName": "Summer 20% Off",    "locationIds": ["TG9jYXRpb246MTgwMDI4OQ=="],    "postType": "OFFER",    "postSites": ["GOOGLE"],    "postMessage": [{ "site": "GOOGLE", "message": "20% off through July!" }],    "postContextInfo": {      "title": "Summer Sale",      "couponCode": "SUMMER20",      "redeemUrl": "https://example.com/offer",      "termsConditions": "Valid through July 31",      "startDay": "2026-07-10",      "startTime": "09:00",      "endDay": "2026-07-31",      "endTime": "23:59"    }  }}

Dikkat edilmesi gerekenler.

  • Gövde input içine alınmalıdır; alanların en üst düzeyde gönderilmesi HTTP 400 döndürülmesine neden olur.
  • postType, postSites, postName ve locationIds zorunludur; EVENT, OFFER ve PRODUCT türleri ayrıca eşleşen postContextInfo (veya products) alanlarını gerektirir.
  • postSites yalnızca GOOGLE ve FACEBOOK kabul eder; hedef konumlarda ilgili kanalın bağlı olması gerekir, aksi takdirde ilgili konum atlanır.
  • Doğrulamanın kısmen veya tamamen başarısız olması durumunda yanıt, success: false ve doldurulmuş bir errors dizisiyle birlikte HTTP 200 döndürür; success değerini kontrol edin, ardından toplu gönderiyi getirme uç noktasını kullanarak her konum için yayımlanma durumunu canlı olarak takip edin.
Request
curl -X POST 'https://listingsapi.com/api/v4/bulk-posts' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "postName": "July Reopening Announcement",      "locationIds": [        "TG9jYXRpb246MTgwMDI4OQ==",        "TG9jYXRpb246MTgwMDI5MA=="      ],      "postType": "ANNOUNCEMENT",      "postSites": [        "GOOGLE",        "FACEBOOK"      ],      "postMessage": [        {          "site": "GOOGLE",          "message": "We're back! Visit us this week for our summer menu."        },        {          "site": "FACEBOOK",          "message": "We're back! Swing by for the new summer menu."        }      ],      "postMediaUrl": [        {          "site": "GOOGLE",          "url": "https://cdn.example.com/summer.jpg",          "type": "IMAGE"        }      ],      "postScheduledDates": {        "startDatetime": "2026-07-10T09:00:00Z",        "endDatetime": "2026-07-24T23:59:00Z"      }    }  }'