Home / Docs Center / Pet Feeder (ODM Case) / FamilyInvite PageDocs
FamilyInvite PageDocs
Family Invitation Page Interface Documentation
Overview
- Path:
/invite/:code - Method:
GET - Authentication required: No (public route)
- Response type:
text/html; charset=utf-8 - Description: Returns an H5 invitation landing page. When there is no token, a download guide page is displayed; when a valid token is carried, it automatically attempts to join the family and returns a result page.
Path Parameters
| Parameters | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Invitation code, generated by /api/family/invite Generate |
Optional authentication parameters
This interface supports two ways to import the user JWT Token to automatically complete the addition action on the H5 page:
| Modalities | Description |
|---|---|
| Request Header | X-Token: <JWT Token> |
| Query Arguments | ?token=<JWT Token>(back and forth spaces will be removed) |
Priority: Request head & gt; Query parameters. Shows the page that guides the user to open App or downloads App when token is not carried.
Page Behaviour Description
| Conditions | Page Presentation |
|---|---|
| not carried token | Show an invitation guide page and provide two buttons for Deep Link and Download App |
| token effective & add successful | Shows the successful page, displays the family names that have been added and provides the Deep Link button to jump App |
| token invalid / expired | Shows an invalid page, hints, "Input information expired, please re-enter App" |
| token valid & joined failed | Display an invalid page showing the error information returned by the service (e. g. the invitation code has expired, is a family member, etc.) |
Deep Link Format
| Scenario | Deep Link |
|---|---|
| Open invitation | xunswei://invite/{code} |
| View Family | xunswei://family/{familyId} |
Response Example
1. token without carrying
GET /invite/abc123xyz
Returns HTTP 200,Content-Type: text/html; charset=utf-8, page description:
🐾 好友邀请您加入家庭
点击下方按钮在 App 内查看邀请详情并加入家庭。
[已有 App?点此打开] → xunswei://invite/abc123xyz
[下载 App] → {AppDownloadURL}
carrying valid token, joining successful
GET /invite/abc123xyz?token=<JWT>
Returns HTTP 200, page description:
✅ 加入成功!
您已成功加入家庭《我的家庭》,请回到 App 查看家庭信息。
[在 App 内查看] → xunswei://family/{familyId}
3. token invalid or failed to join
GET /invite/abc123xyz?token=<无效JWT>
Returns HTTP 200, page description:
⚠️ 邀请失效
登录信息已过期,请重新登录 App。
[已有 App?点此打开] → xunswei://invite/abc123xyz
[下载 App] → {AppDownloadURL}
Use process
1. App 调用 POST /api/family/invite 获取邀请码和邀请链接
2. 用户将链接分享给好友(链接形如 https://example.com/invite/{code})
3. 好友在浏览器打开链接:
a. 未安装 App → 点击"下载 App"按钮
b. 已安装 App → 点击"在 App 内打开"触发 Deep Link,进入 App 后调用
POST /api/family/join 完成加入
c. H5 页面内携带 token → 自动加入,无需跳转 App
Invitation valid
The invite code is generated by /api/family/invite 24 hours (86400 seconds). After it expires, visiting this page will display the "Invitation invalid" page. (0) Seconds. Timeout access to this page will display the "inviolation" page.
Notes
- This endpoint always returns HTTP
200, separates a different state by page content and does not use the JSON unified response format. AppDownloadURLis driven by the server-side settingserver.app_download_urlDecision.- The interface has no cross-domain limit and can be accessed directly in the browser.
Didn't find what you need?Contact us, talk to our engineers directly.
, talk to our engineers directly.