/api/v4/postsCriar uma publicação de anúncio
Cria uma publicação social do tipo ANNOUNCEMENT e a publica nos sites escolhidos para um ou mais locais.
Parâmetros
Corpo
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| input | object | obrigatório | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.postName | string | obrigatório | Internal name for the campaign (not shown to customers). |
| input.locationIds | array of strings | obrigatório | Base64-encoded location IDs to publish to (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). |
| input.postType | string | obrigatório | Must be `ANNOUNCEMENT`. One of EVENT, OFFER, ANNOUNCEMENT, COVID19, PRODUCT. |
| input.postSites | array of strings | obrigatório | Sites to publish to: `GOOGLE`, `FACEBOOK`. |
| input.postMessage | array of objects | opcional | Per-site body text: `{ site, message }`. Provide one entry per site in `postSites`. |
| input.postCta | array of objects | opcional | 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 | opcional | Optional media per site: `{ site, url, type }` where `type` is IMAGE or VIDEO. |
| input.clientMutationId | string | opcional | Optional client token returned unchanged in the response for correlation. |
Exemplo de requisição
Corpo pronto para colar. Substitua os IDs e valores de exemplo pelos seus.
{ "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" } ] }}Respostas
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.
Cria um anúncio: o tipo mais simples de publicação. Um anúncio contém uma mensagem simples (e, opcionalmente, uma CTA e uma imagem), sem datas de evento nem detalhes de oferta. Passe postType: "ANNOUNCEMENT" e uma entrada postMessage por site em postSites.
Caso de uso: "Estamos abertos" em suas lojas. Anuncie uma inauguração ou novos horários no Google (e no Facebook) para um conjunto de locais em uma única chamada. Forneça uma CTA LEARN_MORE com um link para seu site e uma imagem para enriquecer o cartão. A chamada retorna imediatamente com status: INPROGRESS; consulte GET /posts/{postId} periodicamente com o socialPost.id retornado até que indique SUCCESS e leia publishDetails[].submissionError se houver falha em algum site.
Observações.
- O corpo da requisição deve estar encapsulado em um objeto
input: cada campo (postName,locationIds,postType,postSites, …) é uma propriedade deinput. Um corpo sem esse encapsulamento é rejeitado com HTTP 400 (Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided). postSitese cadapostMessage.siteusam o enum de sites (GOOGLE,FACEBOOK); forneça uma entrada de mensagem para cada site em que você pretende publicar.- Para publicar o mesmo anúncio em muitos locais, passe todos os IDs em
locationIdsaqui ou usePOST /bulk-postspara publicações em larga escala em vários locais. - Para publicações com datas, use eventos; para cupons/descontos, use ofertas.
Operação de gravação: não executada na conta em produção. A requisição e a resposta exibidas são construídas a partir do esquema da API; quando executada, esta operação publica em perfis reais do Google/Facebook.
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" } ] } }'