POST
/api/v4/posts이벤트 게시물 생성
제목과 시작/종료 기간이 있는 EVENT 소셜 게시물을 생성하여 하나 이상의 사업장에 대해 선택한 사이트에 게시합니다.
매개변수
본문
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| input | object | 필수 | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.postName | string | 필수 | Internal name for the campaign (not shown to customers). |
| input.locationIds | array of strings | 필수 | Base64-encoded location IDs to publish to (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). |
| input.postType | string | 필수 | Must be `EVENT`. One of EVENT, OFFER, ANNOUNCEMENT, COVID19, PRODUCT. |
| input.postSites | array of strings | 필수 | Sites to publish to: `GOOGLE`, `FACEBOOK`. |
| input.postContextInfo | object | 선택 | Event details: `{ title, startDay, startTime, endDay, endTime }`. `title` is required by Google for events; `startDay`/`endDay` are dates, `startTime`/`endTime` are display strings like `10:00am`. |
| input.postMessage | array of objects | 선택 | Per-site body text: `{ site, message }`. One entry per site in `postSites`. |
| input.postScheduledDates | object | 선택 | When to publish/expire the post itself: `{ startDatetime, endDatetime, removalSites }`. Distinct from the event's own dates in `postContextInfo`. |
| input.postCta | array of objects | 선택 | Optional call-to-action per site: `{ site, type, url }`. `type` is one of BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP, GET_OFFER. |
| input.postMediaUrl | array of objects | 선택 | Optional media per site: `{ site, url, type }` where `type` is IMAGE or VIDEO. |
| input.clientMutationId | string | 선택 | Optional client token returned unchanged in the response for correlation. |
요청 예시
바로 붙여 넣을 수 있는 본문입니다. 예시 ID와 값을 실제 값으로 바꾸세요.
{ "input": { "postName": "Summer Sale Kickoff Event", "locationIds": ["TG9jYXRpb246MTgwMDI4OQ=="], "postType": "EVENT", "postSites": ["GOOGLE"], "postContextInfo": { "title": "Summer Sale Kickoff", "startDay": "2026-07-15", "startTime": "10:00am", "endDay": "2026-07-15", "endTime": "06:00pm" }, "postMessage": [ { "site": "GOOGLE", "message": "Join us for the Summer Sale kickoff, refreshments, giveaways, and up to 40% off in store." } ], "postCta": [ { "site": "GOOGLE", "type": "LEARN_MORE", "url": "https://jennyhome.example/summer-event" } ], "postMediaUrl": [ { "site": "GOOGLE", "url": "https://cdn.example.com/summer-event.jpg", "type": "IMAGE" } ] }}응답
200Post accepted. Publishing runs asynchronously, the returned post starts as INPROGRESS.
{ "data": { "createSocialPost": { "clientMutationId": null, "success": true, "errors": [], "socialPost": { "id": "U29jaWFsUG9zdDo0NDEyMw==", "name": "Summer Sale Kickoff Event", "status": "INPROGRESS", "type": "EVENT", "createdAt": "2026-07-01", "scheduledStartDate": "2026-07-15", "scheduledEndDate": "2026-07-15", "sites": ["GOOGLE"], "message": [ { "site": "GOOGLE", "message": "Join us for the Summer Sale kickoff, refreshments, giveaways, and up to 40% off in store." } ], "cta": [ { "type": { "value": "LEARN_MORE", "label": "Learn more" }, "url": "https://jennyhome.example/summer-event", "site": "GOOGLE", "tinyUrl": null } ], "contextInfo": { "title": "Summer Sale Kickoff", "startDay": "2026-07-15", "startTime": "10:00am", "endDay": "2026-07-15", "endTime": "06:00pm", "couponCode": null, "redeemUrl": null, "termsConditions": null, "discount": null, "locationType": null }, "mediaUrl": [ { "url": "https://cdn.example.com/summer-event.jpg", "site": "GOOGLE", "type": "IMAGE" } ], "publishDetails": [ { "site": "GOOGLE", "status": "PUBLISHING", "createdDate": "2026-07-01", "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.
이벤트 게시물을 생성합니다. 이벤트 게시물은 title 및 시작/종료 기간이 포함된 날짜 지정 공지로, Google에서 이벤트 카드로 표시됩니다. 이벤트 자체의 일정은 postContextInfo(title, startDay, startTime, endDay, endTime)에 있으며, 선택 사항인 postScheduledDates는 게시물 자체의 게시 및 게시 종료 시점을 제어하고, 이 게시 기간은 일반적으로 이벤트를 앞둔 기간입니다.
사용 사례: 매장 내 이벤트 홍보. _Jenny Home_의 "여름 세일 시작"을 알리면서 이벤트 기간을 7월 15일로 지정하고 이벤트 페이지로 연결되는 LEARN_MORE CTA를 포함합니다. postType: "EVENT"를 설정하고 postContextInfo.title을 입력합니다. Google은 제목이 없는 이벤트를 거부합니다. 호출은 status: INPROGRESS를 반환하며, GET /posts/{postId}로 SUCCESS에 도달하는지 확인합니다.
참고 사항.
- 요청 본문은 반드시
input객체로 감싸야 합니다. 모든 필드는input의 속성입니다. 객체로 감싸지 않은 평면 구조의 본문은 HTTP 400(Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided)으로 거부됩니다. postContextInfo에는 이벤트 날짜가 들어가고,postScheduledDates에는 게시 날짜가 들어갑니다.postScheduledDates.startDatetime/endDatetime을 사용하여 게시물을 미리 예약하고 이벤트 후에 자동으로 만료되도록 합니다.postSites의 각 사이트에 대해postMessage항목을 제공합니다.- 날짜가 없는 일반 메시지에는 공지를 사용하고, 쿠폰/할인에는 혜택을 사용합니다.
쓰기 작업: 실제 계정에서는 실행되지 않았습니다. 표시된 요청과 응답은 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": "Summer Sale Kickoff Event", "locationIds": [ "TG9jYXRpb246MTgwMDI4OQ==" ], "postType": "EVENT", "postSites": [ "GOOGLE" ], "postContextInfo": { "title": "Summer Sale Kickoff", "startDay": "2026-07-15", "startTime": "10:00am", "endDay": "2026-07-15", "endTime": "06:00pm" }, "postMessage": [ { "site": "GOOGLE", "message": "Join us for the Summer Sale kickoff, refreshments, giveaways, and up to 40% off in store." } ], "postCta": [ { "site": "GOOGLE", "type": "LEARN_MORE", "url": "https://jennyhome.example/summer-event" } ], "postMediaUrl": [ { "site": "GOOGLE", "url": "https://cdn.example.com/summer-event.jpg", "type": "IMAGE" } ] } }'