POST/api/v4/posts

공지 게시물 만들기

ANNOUNCEMENT 소셜 게시물을 만들고 하나 이상의 사업장에 대해 선택한 사이트에 게시합니다.

API 키가 필요합니다. 헤더 형식과 키 교체는 인증을 참고하세요.

매개변수

본문

이름유형필수설명
inputobject필수Wrapper object. Every field below is a property of `input`, the entire body must be nested under it.
input.postNamestring필수Internal name for the campaign (not shown to customers).
input.locationIdsarray of strings필수Base64-encoded location IDs to publish to (e.g. `TG9jYXRpb246MTgwMDI4OQ==`).
input.postTypestring필수Must be `ANNOUNCEMENT`. One of EVENT, OFFER, ANNOUNCEMENT, COVID19, PRODUCT.
input.postSitesarray of strings필수Sites to publish to: `GOOGLE`, `FACEBOOK`.
input.postMessagearray of objects선택Per-site body text: `{ site, message }`. Provide one entry per site in `postSites`.
input.postCtaarray of objects선택Optional 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 objects선택Optional media per site: `{ site, url, type }` where `type` is IMAGE or VIDEO.
input.clientMutationIdstring선택Optional client token returned unchanged in the response for correlation.

요청 예시

바로 붙여 넣을 수 있는 본문입니다. 예시 ID와 값을 실제 값으로 바꾸세요.

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

응답

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.

가장 단순한 게시물 유형인 공지를 만듭니다. 공지에는 이벤트 날짜나 혜택 세부 정보 없이 일반 메시지가 포함되며, 선택적으로 CTA와 이미지를 추가할 수 있습니다. postType: "ANNOUNCEMENT"를 전달하고 postSites에 사이트별로 postMessage 항목을 하나씩 전달합니다.

사용 사례: 여러 매장에 "영업 중입니다" 공지 게시하기. 한 번의 호출로 여러 사업장의 정식 개장이나 새로운 영업시간을 Google(및 Facebook)에 알립니다. 더 풍부한 카드를 구성하려면 웹사이트로 연결되는 LEARN_MORE CTA와 이미지를 제공합니다. 호출은 status: INPROGRESS를 즉시 반환합니다. 반환된 socialPost.id로 GET /posts/{postId}를 폴링하여 값이 SUCCESS가 될 때까지 확인하고, 어느 사이트에서든 실패하면 publishDetails[].submissionError를 확인합니다.

참고 사항.

  • 요청 본문은 반드시 input 객체로 감싸야 합니다. 모든 필드(postName, locationIds, postType, postSites, …)는 input의 속성입니다. 객체로 감싸지 않은 평면 구조의 본문은 HTTP 400(Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided)으로 거부됩니다.
  • postSites와 각 postMessage.site는 사이트 열거형(GOOGLE, FACEBOOK)을 사용하며, 대상 사이트마다 메시지 항목을 제공해야 합니다.
  • 동일한 공지를 여러 사업장에 게시하려면 여기에서 locationIds에 모든 ID를 전달하거나, 대규모로 여러 사업장에 게시할 때는 POST /bulk-posts를 사용합니다.
  • 날짜가 지정된 게시물에는 이벤트를 사용하고, 쿠폰이나 할인에는 혜택을 사용합니다.

쓰기 작업: 실제 계정에서는 실행하지 않았습니다. 표시된 요청과 응답은 API 스키마를 기반으로 구성되었으며, 실행하면 실제 Google/Facebook 프로필에 게시됩니다.

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