Files
cozsweet-frontend-nextjs/docs/external-entry/README.md
T

2.3 KiB
Raw Blame History

外部入口接入说明

外部应用通过 /external-entry 进入本应用。

环境 APP HOST
测试环境 frontend-test.banlv-ai.com
正式环境 cozsweet.com

入口格式:

https://<APP_HOST>/external-entry?<参数>

可选参数

所有参数均为可选参数。

参数 可选值或格式 用途
target chattipprivate-zoom 指定进入的页面;不传或值无效时进入聊天页。
character eliomayanayeli 指定角色;不传或值无效时使用 Elio。
psid string 传入 Facebook Page-scoped User ID。
mode promotion 开启聊天促销模式。
promotion_type voiceimageprivate 指定促销消息类型,仅与 mode=promotion 一起使用。

mode=promotion 只有在 target=chat 且同时提供有效的 promotion_type 时生效。

PSID 与登录状态流程

PSID 保存、登录状态判断和 Facebook Identity 绑定逻辑见 PSID 与登录状态流程图

使用示例

普通聊天:

https://<APP_HOST>/external-entry?target=chat

进入 Maya 聊天:

https://<APP_HOST>/external-entry?target=chat&character=maya

携带 PSID 进入聊天,示例 PSID 为 27511427698460020

https://<APP_HOST>/external-entry?target=chat&psid=27511427698460020

语音促销聊天:

https://<APP_HOST>/external-entry?target=chat&mode=promotion&promotion_type=voice

图片促销聊天:

https://<APP_HOST>/external-entry?target=chat&mode=promotion&promotion_type=image

私密文本促销聊天:

https://<APP_HOST>/external-entry?target=chat&mode=promotion&promotion_type=private

咖啡打赏:

https://<APP_HOST>/external-entry?target=tip

私密空间:

https://<APP_HOST>/external-entry?target=private-zoom

进入 Nayeli 私密空间:

https://<APP_HOST>/external-entry?target=private-zoom&character=nayeli

psid 可以与任意 target 或聊天促销参数组合使用。参数值需要进行 URL 编码,不要在入口中传递登录 Token、Page Access Token 或 App Secret。

完整可点击示例: