POST/api/v4/posts

Ankü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.

Erfordert einen API-Schlüssel. Format des Headers und Schlüsselrotation finden Sie unter Authentifizierung.

Parameter

Body

NameTypErforderlichBeschreibung
inputobjecterforderlichWrapper object. Every field below is a property of `input`, the entire body must be nested under it.
input.postNamestringerforderlichInternal name for the campaign (not shown to customers).
input.locationIdsarray of stringserforderlichBase64-encoded location IDs to publish to (e.g. `TG9jYXRpb246MTgwMDI4OQ==`).
input.postTypestringerforderlichMust be `ANNOUNCEMENT`. One of EVENT, OFFER, ANNOUNCEMENT, COVID19, PRODUCT.
input.postSitesarray of stringserforderlichSites to publish to: `GOOGLE`, `FACEBOOK`.
input.postMessagearray of objectsoptionalPer-site body text: `{ site, message }`. Provide one entry per site in `postSites`.
input.postCtaarray of objectsoptionalOptional call-to-action button per site: `{ site, type, url }`. `type` is one of BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP, GET_OFFER.
input.postMediaUrlarray of objectsoptionalOptional media per site: `{ site, url, type }` where `type` is IMAGE or VIDEO.
input.clientMutationIdstringoptionalOptional client token returned unchanged in the response for correlation.

Beispielanfrage

Body zum direkten Einfügen. Ersetzen Sie Platzhalter-IDs und -Werte durch Ihre eigenen.

Request body
{  "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.
Response
{  "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 von input. Ein flacher, nicht eingebetteter Anfrageinhalt wird mit HTTP 400 (Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided) abgelehnt.
  • postSites und jedes postMessage.site verwenden 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 locationIds oder verwenden Sie POST /bulk-posts fü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.

Request
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"        }      ]    }  }'