POST
/api/v4/social/brands/update更新品牌
更新社群品牌的名稱、時區、網站、類別、主題標籤或簡介。
參數
請求主體
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
| input | object | 必填 | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.profileId | string | 必填 | UUID of the brand to update. This is the same value used as the `brandId` path token elsewhere. |
| input.profileName | string | 選填 | New display name. |
| input.timezone | object | 選填 | New timezone as `{ label, tzCode, name, utc }`. `tzCode` is the IANA identifier that schedules are resolved against. |
| input.businessIntent | string | 選填 | One or two sentences describing what the business does. |
| input.categories | array of strings | 選填 | Business categories. Replaces the stored list rather than merging into it. |
| input.siteUrl | string | 選填 | The brand's website. Changing it queues a fresh read of the site. |
| input.logo | string | 選填 | Public https URL of the brand logo. |
| input.countryIso | string | 選填 | Two-letter ISO country code. |
| input.bio | string | 選填 | Short brand bio. |
| input.brandHashtags | array of strings | 選填 | Replaces the brand's hashtag list. |
| input.competitorHashtags | array of strings | 選填 | Replaces the competitor hashtag list. |
| input.contentPreferredLanguage | string | 選填 | Preferred language for generated content, e.g. `en`. |
請求範例
可直接貼上的請求主體。請將預留位置 ID 與值換成您自己的。
{ "input": { "profileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "profileName": "Jenny Home & Co.", "siteUrl": "https://jennyhomeandco.example", "brandHashtags": ["jennyhome", "handmadefurniture", "shoplocal"] }}回應
200Brand updated. The full brand is returned.
{ "data": { "updateSocialProfile": { "success": true, "error": null, "socialProfile": { "id": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "profileName": "Jenny Home & Co.", "archived": false, "logo": null, "profileLogo": null, "siteUrl": "https://jennyhomeandco.example", "countryIso": "US", "bio": "Handmade furniture for real homes.", "businessIntent": "A family-run home furnishings store selling handmade furniture and textiles.", "categories": ["Furniture Store", "Home Goods"], "brandHashtags": ["jennyhome", "handmadefurniture", "shoplocal"], "competitorHashtags": [], "connectedChannelCount": 3, "timezone": { "label": "(GMT-05:00) Eastern Time", "tzCode": "America/New_York", "name": "Eastern Standard Time", "utc": "-05:00" }, "contentPreferredLanguage": "en" } } }}200Validation failed. The status is still 200: read `success`.
{ "data": { "updateSocialProfile": { "success": false, "error": { "message": "SY95046: Unknown timezone", "code": "SY95046", "contextInfo": null }, "socialProfile": null } }}401Unauthenticated, missing or invalid API key.
404No brand with that ID on this account (`SY95043`).
編輯現有品牌。品牌是透過請求主體中的 input.profileId 指定,而非透過路徑參數,因此路由採用不含路徑參數的 POST /social/brands/update。
使用案例:讓品牌與您自己的 CRM 保持同步。當客戶變更商家名稱或遷移網站時,請在此同步變更,讓品牌頁首和編輯器的建議保持準確。變更 siteUrl 也會將重新讀取網站的作業加入佇列,讓建議採用新的文案,無須再次呼叫。
注意事項。
- 請求主體必須包在
input物件中。 - 請檢查
success,而非 HTTP 狀態。更新遭拒時會傳回HTTP 200,並包含success: false,原因則位於error。 - 只有
profileId為必填欄位。其他所有欄位皆為選填,因此支援部分更新:只需傳送您要變更的欄位,其餘欄位會保持不變。此處用來識別品牌的欄位是profileId,而非brandId;brandId一律僅作為 URL 路徑中的佔位符。 - 傳送
categories、brandHashtags和competitorHashtags時,會取代原有內容,而非合併。傳送[]會清空清單。 - 變更
timezone會影響未來scheduleDate/scheduleTime值的解讀方式。已排程的貼文會保留先前解析出的確切時間點,不會重新調整時間。請透過GET /social/brands/{brandId}重新讀取品牌以確認。
寫入操作:未對正式帳戶執行。此處顯示的請求與回應是根據 API 結構描述建構的。
Request
curl -X POST 'https://listingsapi.com/api/v4/social/brands/update' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "profileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "profileName": "Jenny Home & Co.", "siteUrl": "https://jennyhomeandco.example", "brandHashtags": [ "jennyhome", "handmadefurniture", "shoplocal" ] } }'