门店创建连接链接

门店

创建连接链接

返回托管链接,用户在 Sofia 上授权网络,因此网络令牌不会到达你的应用。链接有效期 30 分钟,仅限正式应用使用。

POSThttps://api.sofia-post.com/api/v1/establishments/{id}/connection-links
POSThttps://api.sofia-post.com/api/v1/establishments/{id}/connection-links

创建连接链接

返回托管链接,用户在 Sofia 上授权网络,因此网络令牌不会到达你的应用。链接有效期 30 分钟,仅限正式应用使用。

授权

Authorizationstring必填

你的个人密钥或 OAuth 访问令牌,以 Bearer <token> 发送。

仅保存在此标签页中,且仅发送到 api.sofia-post.com。 获取 API 密钥

路径参数

idstring必填

门店的标识符。

请求体

此请求将作用于你的真实账户。

创建一个托管的连接链接,并把所有者带到该链接。链接有效期为 30 分钟;结束时,如果 Sofia 认可其来源,会把用户带回你的 redirectUrl。

curl -X POST https://api.sofia-post.com/api/v1/establishments/$ESTABLISHMENT_ID/connection-links \
  -H "Authorization: Bearer $SOFIA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"platform":"linkedin","redirectUrl":"https://app.example.com/sofia/connected"}'

已经连接的平台会返回 409 account_already_connected;Sofia 未提供的平台会返回 422 platform_not_offered。

授权

  • Authorizationstringheader必填

    你的个人密钥或 OAuth 访问令牌,以 Bearer <token> 发送。

路径参数

  • idstring必填

    门店的标识符。

请求体

application/json
  • platformstring必填

    要连接的网络

    允许的值: instagramfacebooktiktoklinkedinx

  • redirectUrlstring

    最后把用户送到的地址,仅当 Sofia 认可该来源;否则由 Sofia 页面告知已完成

响应

托管连接链接及其过期时间。

  • platformstring必填

    要连接的网络

  • urlstring必填

    用户打开以连接网络的 Sofia 页面

  • expiresAtstring必填

    链接等待点击的截止时间(ISO 8601)

这个页面对你有帮助吗?