/api/v4/social/postsSosyal medya gönderisi oluşturun
Bir markanın bağlı Facebook, Instagram, X, LinkedIn ve Pinterest hesaplarında taslak, zamanlanmış veya hemen yayımlanan bir gönderi oluşturur.
Parametreler
Gövde
| 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.socialProfileId | string | zorunlu | UUID of the brand publishing the post, the same value used as the `brandId` path token elsewhere. Every platform in `platforms` must already have a connection on this brand. |
| input.name | string | zorunlu | Internal name for the post (not shown to the audience). Used to find it again in lists. |
| input.platforms | array of strings | zorunlu | Platforms to publish to: `FACEBOOK`, `INSTAGRAM`, `TWITTER` (X), `LINKEDIN`, `PINTEREST`. |
| input.content | string | zorunlu | The post body, published to every platform in `platforms`. |
| input.action | string | zorunlu | `DRAFT` to save without publishing, `SCHEDULE` to publish at a future time (requires a schedule), or `PUBLISH` to publish now. |
| input.mediaUrls | array of strings | isteğe bağlı | Public https image URLs to attach. Instagram and Pinterest require at least one. |
| input.videoUrls | array of strings | isteğe bağlı | Public https video URLs to attach. |
| input.link | string | isteğe bağlı | Link to attach to the post where the platform supports one. |
| input.scheduledAt | string | isteğe bağlı | Publish time as an ISO-8601 timestamp with an offset, e.g. `2026-10-02T09:30:00-04:00`. Required when `action` is `SCHEDULE` unless you send `scheduleDate` + `scheduleTime`. Never send both forms. |
| input.scheduleDate | string | isteğe bağlı | Publish date as `YYYY-MM-DD`, interpreted in the **brand's** timezone. Must be sent together with `scheduleTime`. |
| input.scheduleTime | string | isteğe bağlı | Publish time as `HH:MM` (24-hour), interpreted in the **brand's** timezone. Must be sent together with `scheduleDate`. |
| input.connectedChannelIds | array of strings | isteğe bağlı | Restrict publishing to specific connections by their `id` from the connections list. Defaults to the brand's active connection for each platform in `platforms`. |
| input.clientReference | string | isteğe bağlı | Your own identifier for this post, stored and echoed back. Use it to reconcile the post against your own records without holding onto the returned UUID. |
Örnek istek
Yapıştırmaya hazır gövde. Yer tutucu kimlikleri ve değerleri kendi değerlerinizle değiştirin.
{ "input": { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn collection launch", "platforms": ["INSTAGRAM", "FACEBOOK", "LINKEDIN"], "content": "Our autumn collection lands today. Solid oak, hand-finished, made two blocks from the shop. Come see it in person this weekend.", "mediaUrls": ["https://cdn.example.com/social/autumn-collection.jpg"], "link": "https://jennyhome.example/autumn", "action": "SCHEDULE", "scheduleDate": "2026-10-02", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-01" }}Yanıtlar
200Post accepted. Publishing runs asynchronously, poll GET /social/posts/{postId} for per-channel status.
{ "data": { "createSimpleSocialMediaPost": { "success": true, "error": [], "socialPostId": "c47a1e58-2b93-4f10-a6d7-58e0c9b12345", "status": "SCHEDULED" } }}200Validation failed. Nothing was created. The status is still 200: read `success` and the `error` array.
{ "data": { "createSimpleSocialMediaPost": { "success": false, "error": [ { "message": "SY95045: No connected channel for PINTEREST on this brand", "code": "SY95045", "contextInfo": [{ "key": "platform", "value": "PINTEREST" }] }, { "message": "SY95046: scheduleTime must be HH:MM in the brand's timezone", "code": "SY95046", "contextInfo": null } ], "socialPostId": null, "status": null } }}401Unauthenticated, missing or invalid API key.
404No brand with that ID on this account (`SY95043`).
Bir marka için, markanın bağlı sosyal medya hesaplarından birinde veya birkaçında tek bir gönderi oluşturur. Aynı çağrı üç yaşam döngüsünü de kapsar: DRAFT kaydetme, SCHEDULE kuyruğa alma veya hemen PUBLISH.
Kullanım örneği: kendi takviminizden bir kampanya zamanlama. Uygulamanız, bir müşterinin ne söylemek istediğini ve bunu ne zaman söylemek istediğini zaten bilir. Her zaman dilimi için bu uç noktayı action: "SCHEDULE" ve scheduledAt ya da scheduleDate + scheduleTime ile çağırın ve döndürülen UUID'yi saklamadan eşleştirme yapabilmek için kendi zaman dilimi tanımlayıcınızı clientReference olarak iletin. GET /social/posts/{postId}, gönderinin tüm kanallarda yayımlandığını bildirene kadar kaydı beklemede olarak gösterin ve POST /social/posts/cancel çağrısını yapan bir iptal düğmesi sunun.
Yayımlama eşzamansızdır
action: "PUBLISH", yanıt vermeden önce gönderiyi yayımlamaz. Çağrı gönderiyi kabul eder, bir socialPostId döndürür ve gönderiyi yayımlama sürecine aktarır. Gerçekte ne olduğunu öğrenmek için GET /social/posts/{postId} uç noktasını düzenli aralıklarla sorgulayın ve kanal bazındaki channels[] dizisini okuyun: her kaydın status değeri, ilgili platformdaki sonucu gösterir. Aynı istekte bir gönderi Instagram'da başarıyla yayımlanırken LinkedIn'de başarısız olabilir; bu nedenle channels[] gerçek durumu gösterir, gönderi düzeyindeki status ise bir özettir.
Zamanlama seçimi
action: "SCHEDULE", iki biçimden tam olarak birini gerektirir; ikisi birden kullanılamaz:
Her ikisini birden göndermek, scheduleDate alanını scheduleTime olmadan göndermek veya saat farkı içermeyen bir scheduledAt göndermek, SY95046 ile reddedilir. DRAFT ve PUBLISH hiçbir şekilde zamanlama içermemelidir.
Notlar.
- İstek gövdesi bir
inputnesnesi içine alınmalıdır. - HTTP durumunu değil,
successdeğerini kontrol edin. Doğrulama hataları,success: falseveerrordizisinde her sorun için bir kayıt içerenHTTP 200olarak döndürülür.successdeğerifalseolduğunda hiçbir şey oluşturulmaz. - Marka, gövdede
socialProfileIdile tanımlanır.brandIdyalnızca bir URL yolu belirtecidir; hiçbir zaman gövde alanı değildir. platformsiçindeki her platformun markada önceden kurulmuş bir bağlantısı olmalıdır. Etkin kanalı olmayan bir platformSY95045ile başarısız olur; önce markanın bağlantılarını okuyun ve eksik olan her bağlantı için kullanıcıyı bir bağlantı kurma bağlantısına yönlendirin.- Platform değerleri, büyük harfli enum adları olan
FACEBOOK,INSTAGRAM,TWITTER,LINKEDINvePINTERESTdeğerleridir.TWITTER, X'i ifade eder; değer eski adını korumuştur ve küçük harfli bir değer reddedilir. - Instagram ve Pinterest, yalnızca metin içeren bir gönderiyi kabul etmez:
platformsiçinde bu platformlardan biri varsa en az birmediaUrlskaydı sağlayın. - Gönderi kimlikleri, konum gönderilerinde kullanılan Base64 relay kimlikleri değil, düz UUID'lerdir.
- Tek seferde birkaç gönderiden fazlası için aynı satır yapısını kabul eden ve tüm grubu baştan doğrulayan
POST /social/bulk-postsuç noktasını kullanın.
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 gönderi yayımlar.
curl -X POST 'https://listingsapi.com/api/v4/social/posts' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn collection launch", "platforms": [ "INSTAGRAM", "FACEBOOK", "LINKEDIN" ], "content": "Our autumn collection lands today. Solid oak, hand-finished, made two blocks from the shop. Come see it in person this weekend.", "mediaUrls": [ "https://cdn.example.com/social/autumn-collection.jpg" ], "link": "https://jennyhome.example/autumn", "action": "SCHEDULE", "scheduleDate": "2026-10-02", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-01" } }'