跳转到主要内容
使用 Business 或 Enterprise 方案的整合商可以將客戶的社群帳戶匯入到 子設定檔(sub-profile) 之下。透過 MCP Server,代理程式會建立一個子設定檔並將其設為目標,然後產生一個單一登入的連結 URL 供客戶開啟以連結其帳戶。

流程

1

建立子設定檔

呼叫 create_profile(帳戶層級 — 不需要 profileKey)。它會回傳新子設定檔的 profile key
2

將子設定檔設為目標

在後續呼叫中使用回傳的 profile key —— 可以透過連線上的 Profile-Key 標頭,或是作為單次呼叫的 profileKey 參數傳入。有關優先順序請參見 Connect & Setup
3

產生社群連結 URL

呼叫 generate_jwt_social_linking_url 以產生一個單一登入的連結 URL。JWT 簽章金鑰和匯入網域都在 伺服器端 推導 —— 呼叫端 不需要 提供任何 X-Ayrshare-* 標頭,也不需要提供私密金鑰或網域。
4

客戶連結其帳戶

客戶開啟該 URL 並對其社群帳戶進行授權(OAuth)。已連線的帳戶會關聯到該子設定檔。

前置需求

generate_jwt_social_linking_url 必須 提供 profileKey。如果無法解析出 profileKey,呼叫會回傳 400,訊息為 “Profile Key is required…”你的帳戶還必須 已佈建社群連結網域(social-linking domain)。此功能在 BusinessEnterprise 方案中提供。

錯誤狀態

條件回應
未佈建網域400 — “No social-linking domain is provisioned for this account (available on Business/Enterprise plans).”
無簽章金鑰400 — “No signing key found for this account’s social-linking domain.”

後續步驟

Connect & Setup

身分驗證與設定檔定位。

工具目錄

按領域分組的 27 個工具,包含適用範圍與用途。