POST/api/v4/bulk-posts

一括投稿を作成する

1つのソーシャル投稿を作成し、1回のリクエストで複数の拠点に公開します。

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 publicly).
input.locationIdsarray of strings必須Base64-encoded location Relay IDs to publish to.
input.postTypestring必須One of `EVENT`, `OFFER`, `ANNOUNCEMENT`, `COVID19`, `PRODUCT`.
input.postSitesarray of strings必須Target publishers: `GOOGLE` and/or `FACEBOOK`.
input.postMessagearray of objects任意Per-site post body. Each entry: `site` and `message`.
input.postMessage[].sitestring必須Publisher for this message: `GOOGLE` or `FACEBOOK`.
input.postMessage[].messagestring必須Post body text for that site.
input.postMediaUrlarray of objects任意Per-site media. Each entry: `site`, `url`, and `type` (`IMAGE` or `VIDEO`).
input.postMediaUrl[].sitestring必須Publisher for this media asset.
input.postMediaUrl[].urlstring必須Publicly accessible media URL.
input.postMediaUrl[].typestring任意`IMAGE` or `VIDEO`.
input.postCtaarray of objects任意Per-site call-to-action button. Each entry: `site`, `type`, `url`.
input.postScheduledDatesobject任意Scheduling window: `startDatetime`, `endDatetime`, and optional `removalSites`. When provided, the post is created with status `SCHEDULED`.
input.postScheduledDates.startDatetimestring必須ISO-8601 datetime the post goes live.
input.postScheduledDates.endDatetimestring必須ISO-8601 datetime the post is removed.
input.postContextInfoobject任意Type-specific details (offer coupon/redeem/terms, or event title/times). Required by `OFFER`, `EVENT`, and `PRODUCT` posts.
input.productsarray of objects任意Product entries for `PRODUCT` posts (name, price, photo, cta).
input.componentIdentifierstring任意Optional client component reference for tracking.
input.componentTypestring任意Optional client component type for tracking.

リクエストの例

そのまま貼り付けられるボディです。プレースホルダーの ID と値をご自身のものに置き換えてください。

Request body
{  "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"    }  }}

レスポンス

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`.
Response
{  "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.

1つの投稿キャンペーンを作成してlocationIds内のすべての拠点に展開し、選択したpostSitesに公開します。拠点ごとの作成とは異なり、1回の呼び出しですべての拠点を対象にできるため、全社的なお知らせ、特典、イベントを効率的に実施できます。

リクエストの構造。 リクエストボディ全体をinputオブジェクトで囲み、すべてのフィールド(postName、locationIds、postType、…)をinputのプロパティにする必要があります。オブジェクトで囲まれていないフラットなリクエストボディは、HTTP 400(Variable "$input" of required type ... was not provided)で拒否されます。これはPOST /postsと同じ仕様であり、成功時のレスポンスは一括処理専用のキーではなく、createSocialPostをキーとして返されます。

ユースケース:全社的なお知らせ(上記の例)。 postType: "ANNOUNCEMENT"を設定し、拠点IDを列挙して、サイトごとに1つのpostMessageを指定します。一定の期間にわたって投稿を公開するにはpostScheduledDatesを追加し(この場合、投稿はステータスSCHEDULEDで作成されます)、すぐに公開するには省略します。

ユースケース:全店舗での期間限定特典。 postTypeをOFFERに切り替え、postContextInfoにクーポンを指定します(引き続きinputで囲む必要があります):

JSON
{  "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"    }  }}

注意点。

  • リクエストボディはinputで囲む必要があり、フィールドをトップレベルで送信するとHTTP 400が返されます。
  • postType、postSites、postName、locationIdsは必須であり、EVENT、OFFER、PRODUCTのタイプでは、対応するpostContextInfo(またはproducts)フィールドも必須です。
  • postSitesで指定できるのはGOOGLEとFACEBOOKのみです。対象の拠点には対応するチャネルが接続されている必要があり、接続されていない場合、そのサイトはスキップされます。
  • 検証が一部またはすべて失敗した場合、success: falseと要素が格納されたerrors配列を含むHTTP 200レスポンスが返されるため、successを確認してから、一括投稿を取得するエンドポイントで拠点ごとの実際の配信状況を追跡してください。
Request
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"      }    }  }'