/api/v4/bulk-postsCrear una publicación masiva
Crea una publicación en redes sociales y la publica en muchas ubicaciones con una sola solicitud.
Parámetros
Cuerpo
Un campo anidado marcado como obligatorio solo se aplica cuando envías su campo principal. Si el campo principal es opcional y lo omites, sus campos hijos obligatorios no se aplican.
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| input | object | obligatorio | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.postName | string | obligatorio | Internal name for the campaign (not shown publicly). |
| input.locationIds | array of strings | obligatorio | Base64-encoded location Relay IDs to publish to. |
| input.postType | string | obligatorio | One of `EVENT`, `OFFER`, `ANNOUNCEMENT`, `COVID19`, `PRODUCT`. |
| input.postSites | array of strings | obligatorio | Target publishers: `GOOGLE` and/or `FACEBOOK`. |
| input.postMessage | array of objects | opcional | Per-site post body. Each entry: `site` and `message`. |
| input.postMessage[].site | string | obligatorio | Publisher for this message: `GOOGLE` or `FACEBOOK`. |
| input.postMessage[].message | string | obligatorio | Post body text for that site. |
| input.postMediaUrl | array of objects | opcional | Per-site media. Each entry: `site`, `url`, and `type` (`IMAGE` or `VIDEO`). |
| input.postMediaUrl[].site | string | obligatorio | Publisher for this media asset. |
| input.postMediaUrl[].url | string | obligatorio | Publicly accessible media URL. |
| input.postMediaUrl[].type | string | opcional | `IMAGE` or `VIDEO`. |
| input.postCta | array of objects | opcional | Per-site call-to-action button. Each entry: `site`, `type`, `url`. |
| input.postScheduledDates | object | opcional | Scheduling window: `startDatetime`, `endDatetime`, and optional `removalSites`. When provided, the post is created with status `SCHEDULED`. |
| input.postScheduledDates.startDatetime | string | obligatorio | ISO-8601 datetime the post goes live. |
| input.postScheduledDates.endDatetime | string | obligatorio | ISO-8601 datetime the post is removed. |
| input.postContextInfo | object | opcional | Type-specific details (offer coupon/redeem/terms, or event title/times). Required by `OFFER`, `EVENT`, and `PRODUCT` posts. |
| input.products | array of objects | opcional | Product entries for `PRODUCT` posts (name, price, photo, cta). |
| input.componentIdentifier | string | opcional | Optional client component reference for tracking. |
| input.componentType | string | opcional | Optional client component type for tracking. |
Solicitud de ejemplo
Cuerpo listo para pegar. Sustituye los ID y valores de ejemplo por los tuyos.
{ "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" } }}Respuestas
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.
Crea una única campaña de publicación y la distribuye a todas las ubicaciones de locationIds, publicándola en los postSites seleccionados. A diferencia de la creación por ubicación, una sola llamada abarca todas tus ubicaciones, lo que permite difundir de forma eficiente un anuncio, una oferta o un evento para toda la empresa.
Estructura de la solicitud. Todo el cuerpo debe estar envuelto en un objeto input; cada campo (postName, locationIds, postType, …) es una propiedad de input. Un cuerpo plano, sin envolver, se rechaza con un HTTP 400 (Variable "$input" of required type ... was not provided). Este es el mismo contrato que el de POST /posts, y una respuesta correcta utiliza la clave createSocialPost en lugar de una clave específica para publicaciones masivas.
Caso de uso: anuncio para toda la empresa (mostrado arriba). Configura postType: "ANNOUNCEMENT", enumera los ID de las ubicaciones y proporciona un postMessage por ubicación. Añade postScheduledDates para que la publicación esté activa durante un período fijo (la publicación se crea entonces con el estado SCHEDULED); omítelo para publicar de inmediato.
Caso de uso: una oferta por tiempo limitado en todas las tiendas. Cambia postType a OFFER e incluye el cupón en postContextInfo (manteniendo el cuerpo envuelto en input):
{ "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" } }}Aspectos que debes tener en cuenta.
- El cuerpo debe estar envuelto en
input; si envías los campos en el nivel superior, se devuelve un HTTP 400. postType,postSites,postNameylocationIdsson obligatorios; los tiposEVENT,OFFERyPRODUCTrequieren además los campospostContextInfo(oproducts) correspondientes.postSitessolo aceptaGOOGLEyFACEBOOK; las ubicaciones de destino deben tener conectado el canal correspondiente o se omitirá la ubicación.- La respuesta devuelve HTTP 200 con
success: falsey un arrayerrorscon elementos si la validación falla de forma parcial o total; compruebasuccessy, a continuación, supervisa la entrega en tiempo real por ubicación mediante el endpoint de consulta de publicaciones masivas.
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" } } }'