/api/v4/postsAnkündigungsbeitrag erstellen
Erstellt einen Social-Media-Beitrag vom Typ ANNOUNCEMENT und veröffentlicht ihn auf den ausgewählten Plattformen für einen oder mehrere Standorte.
Parameter
Body
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
| input | object | erforderlich | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.postName | string | erforderlich | Internal name for the campaign (not shown to customers). |
| input.locationIds | array of strings | erforderlich | Base64-encoded location IDs to publish to (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). |
| input.postType | string | erforderlich | Must be `ANNOUNCEMENT`. One of EVENT, OFFER, ANNOUNCEMENT, COVID19, PRODUCT. |
| input.postSites | array of strings | erforderlich | Sites to publish to: `GOOGLE`, `FACEBOOK`. |
| input.postMessage | array of objects | optional | Per-site body text: `{ site, message }`. Provide one entry per site in `postSites`. |
| input.postCta | array of objects | optional | Optional call-to-action button per site: `{ site, type, url }`. `type` is one of BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP, GET_OFFER. |
| input.postMediaUrl | array of objects | optional | Optional media per site: `{ site, url, type }` where `type` is IMAGE or VIDEO. |
| input.clientMutationId | string | optional | Optional client token returned unchanged in the response for correlation. |
Beispielanfrage
Body zum direkten Einfügen. Ersetzen Sie Platzhalter-IDs und -Werte durch Ihre eigenen.
{ "input": { "postName": "Grand Opening Announcement", "locationIds": ["TG9jYXRpb246MTgwMDI4OQ=="], "postType": "ANNOUNCEMENT", "postSites": ["GOOGLE"], "postMessage": [ { "site": "GOOGLE", "message": "We are now open! Visit Jenny Home this week for our grand opening." } ], "postCta": [ { "site": "GOOGLE", "type": "LEARN_MORE", "url": "https://jennyhome.example/opening" } ], "postMediaUrl": [ { "site": "GOOGLE", "url": "https://cdn.example.com/opening.jpg", "type": "IMAGE" } ] }}Antworten
200Post accepted. Publishing runs asynchronously, the returned post starts as INPROGRESS.
{ "data": { "createSocialPost": { "clientMutationId": null, "success": true, "errors": [], "socialPost": { "id": "U29jaWFsUG9zdDo0NDEyMg==", "name": "Grand Opening Announcement", "status": "INPROGRESS", "type": "ANNOUNCEMENT", "createdAt": "2026-06-28", "sites": ["GOOGLE"], "message": [ { "site": "GOOGLE", "message": "We are now open! Visit Jenny Home this week for our grand opening." } ], "cta": [ { "type": { "value": "LEARN_MORE", "label": "Learn more" }, "url": "https://jennyhome.example/opening", "site": "GOOGLE", "tinyUrl": null } ], "contextInfo": null, "mediaUrl": [ { "url": "https://cdn.example.com/opening.jpg", "site": "GOOGLE", "type": "IMAGE" } ], "publishDetails": [ { "site": "GOOGLE", "status": "PUBLISHING", "createdDate": "2026-06-28", "submissionError": null } ], "postLinks": [], "locationIds": [1800289] } } }}400Bad request, the body was not wrapped in `input` (error message: `Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided`).
401Unauthenticated, missing or invalid API key.
Erstellt eine Ankündigung: den einfachsten Beitragstyp. Eine Ankündigung enthält eine einfache Nachricht (sowie optional einen CTA und ein Bild) ohne Veranstaltungsdaten oder Angebotsdetails. Übergeben Sie postType: "ANNOUNCEMENT" und für jede Plattform einen postMessage-Eintrag in postSites.
Anwendungsfall: „Wir haben geöffnet“ für Ihre Filialen. Kündigen Sie eine Neueröffnung oder neue Öffnungszeiten für eine Gruppe von Standorten mit einem einzigen Aufruf auf Google (und Facebook) an. Geben Sie einen LEARN_MORE-CTA mit einem Link zu Ihrer Website und ein Bild an, um die Karte ansprechender zu gestalten. Der Aufruf gibt sofort status: INPROGRESS zurück; fragen Sie GET /posts/{postId} mit dem zurückgegebenen socialPost.id wiederholt ab, bis der Status SUCCESS lautet, und lesen Sie publishDetails[].submissionError, falls die Veröffentlichung auf einer Plattform fehlschlägt.
Hinweise.
- Der Anfrageinhalt muss in ein
input-Objekt eingebettet sein: Jedes Feld (postName,locationIds,postType,postSites, …) ist eine Eigenschaft voninput. Ein flacher, nicht eingebetteter Anfrageinhalt wird mit HTTP 400 (Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided) abgelehnt. postSitesund jedespostMessage.siteverwenden die Plattform-Enumeration (GOOGLE,FACEBOOK); geben Sie für jede Zielplattform einen Nachrichteneintrag an.- Um dieselbe Ankündigung an vielen Standorten zu veröffentlichen, übergeben Sie hier entweder alle IDs in
locationIdsoder verwenden SiePOST /bulk-postsfür umfangreiche Veröffentlichungen über mehrere Standorte hinweg. - Verwenden Sie für Beiträge mit Datumsangaben Veranstaltungen; für Gutscheine/Rabatte verwenden Sie Angebote.
Schreiboperation: nicht für das Live-Konto ausgeführt. Die gezeigte Anfrage und Antwort werden aus dem API-Schema erstellt; bei der Ausführung wird auf echten Google-/Facebook-Profilen veröffentlicht.
curl -X POST 'https://listingsapi.com/api/v4/posts' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "postName": "Grand Opening Announcement", "locationIds": [ "TG9jYXRpb246MTgwMDI4OQ==" ], "postType": "ANNOUNCEMENT", "postSites": [ "GOOGLE" ], "postMessage": [ { "site": "GOOGLE", "message": "We are now open! Visit Jenny Home this week for our grand opening." } ], "postCta": [ { "site": "GOOGLE", "type": "LEARN_MORE", "url": "https://jennyhome.example/opening" } ], "postMediaUrl": [ { "site": "GOOGLE", "url": "https://cdn.example.com/opening.jpg", "type": "IMAGE" } ] } }'