/api/v4/bulk-postsToplu gönderi oluşturun
Tek bir sosyal medya gönderisi oluşturur ve tek bir istekte birden fazla konumda yayımlar.
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.
| Ad | Tür | Zorunlu | Açıklama |
|---|---|---|---|
| input | object | zorunlu | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.postName | string | zorunlu | Internal name for the campaign (not shown publicly). |
| input.locationIds | array of strings | zorunlu | Base64-encoded location Relay IDs to publish to. |
| input.postType | string | zorunlu | One of `EVENT`, `OFFER`, `ANNOUNCEMENT`, `COVID19`, `PRODUCT`. |
| input.postSites | array of strings | zorunlu | Target publishers: `GOOGLE` and/or `FACEBOOK`. |
| input.postMessage | array of objects | isteğe bağlı | Per-site post body. Each entry: `site` and `message`. |
| input.postMessage[].site | string | zorunlu | Publisher for this message: `GOOGLE` or `FACEBOOK`. |
| input.postMessage[].message | string | zorunlu | Post body text for that site. |
| input.postMediaUrl | array of objects | isteğe bağlı | Per-site media. Each entry: `site`, `url`, and `type` (`IMAGE` or `VIDEO`). |
| input.postMediaUrl[].site | string | zorunlu | Publisher for this media asset. |
| input.postMediaUrl[].url | string | zorunlu | Publicly accessible media URL. |
| input.postMediaUrl[].type | string | isteğe bağlı | `IMAGE` or `VIDEO`. |
| input.postCta | array of objects | isteğe bağlı | Per-site call-to-action button. Each entry: `site`, `type`, `url`. |
| input.postScheduledDates | object | isteğe bağlı | Scheduling window: `startDatetime`, `endDatetime`, and optional `removalSites`. When provided, the post is created with status `SCHEDULED`. |
| input.postScheduledDates.startDatetime | string | zorunlu | ISO-8601 datetime the post goes live. |
| input.postScheduledDates.endDatetime | string | zorunlu | ISO-8601 datetime the post is removed. |
| input.postContextInfo | object | isteğe bağlı | Type-specific details (offer coupon/redeem/terms, or event title/times). Required by `OFFER`, `EVENT`, and `PRODUCT` posts. |
| input.products | array of objects | isteğe bağlı | Product entries for `PRODUCT` posts (name, price, photo, cta). |
| input.componentIdentifier | string | isteğe bağlı | Optional client component reference for tracking. |
| input.componentType | string | isteğ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.
{ "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`.
{ "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):
{ "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
inputiçine alınmalıdır; alanların en üst düzeyde gönderilmesi HTTP 400 döndürülmesine neden olur. postType,postSites,postNamevelocationIdszorunludur;EVENT,OFFERvePRODUCTtürleri ayrıca eşleşenpostContextInfo(veyaproducts) alanlarını gerektirir.postSitesyalnızcaGOOGLEveFACEBOOKkabul 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: falseve doldurulmuş birerrorsdizisiyle birlikte HTTP 200 döndürür;successdeğerini kontrol edin, ardından toplu gönderiyi getirme uç noktasını kullanarak her konum için yayımlanma durumunu canlı olarak takip edin.
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" } } }'