Home / Docs Center / Pet Feeder (ODM Case) / FamilyInvite PageDocs

FamilyInvite PageDocs

Pet Feeder (ODM Case) · App Server-Side API

Project: Pet Feeder | page_id: 1746

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

Parameter Type Required Description
code string Yes Invitation code, generated by /api/family/invite

Optional Authentication Parameters

This interface supports two ways of passing in the user's JWT Token, used to automatically complete the join action within the H5 page:

Method Description
Request header X-Token: <JWT Token>
Query parameter ?token=<JWT Token> (leading and trailing spaces are removed)

Priority: request header > query parameter. When no token is carried, a page guiding the user to open or download the App is displayed.


Page Behavior Description

Condition Page Content Displayed
No token carried Displays the invitation guide page, providing two buttons: "Open in App" (Deep Link) and "Download App"
Token valid & join successful Displays the success page, showing the name of the family joined, and providing a Deep Link button to jump to the App
Token invalid / expired Displays an invalid page, prompting "Login information has expired, please log in to the App again"
Token valid & join failed Displays an invalid page, showing the error message returned by the server (for example: the invitation code has expired, already a family member, etc.)

Deep Link Format

Scenario Deep Link
Open an invitation xunswei://invite/{code}
View a family xunswei://family/{familyId}

Response Examples

1. No token carried (guide page)

GET /invite/abc123xyz

Returns HTTP 200 with Content-Type: text/html; charset=utf-8. The page content is as follows:

🐾 A friend has invited you to join a family
Click the button below to view the invitation details in the App and join the family.

[Already have the App? Click here to open]   → xunswei://invite/abc123xyz
[Download the App]             → {AppDownloadURL}

2. Valid token carried, join successful

GET /invite/abc123xyz?token=<JWT>

Returns HTTP 200. The page content is as follows:

✅ Joined successfully!
You have successfully joined the family "My Family". Please return to the App to view the family information.

[View in the App]  → xunswei://family/{familyId}

3. Invalid token or join failed

GET /invite/abc123xyz?token=<invalidJWT>

Returns HTTP 200. The page content is as follows:

⚠️ Invitation invalid
The login information has expired. Please log in to the App again.

[Already have the App? Click here to open]   → xunswei://invite/abc123xyz
[Download the App]            → {AppDownloadURL}

Usage Flow

1. The App calls POST /api/family/invite to obtain the invitation code and invitation link
2. The user shares the link with a friend (the link looks like [https://example.com/invite/{code})](https://example.com/invite/{code}))
3. The friend opens the link in a browser:
   a. App not installed → click the "Download App" button
   b. App installed → click "Open in App" to trigger the Deep Link, then after entering the App call
      POST /api/family/join to complete joining
   c. The H5 page carries a token → joins automatically, no need to jump to the App

Invitation Code Validity Period

The invitation code is generated by /api/family/invite and is valid for 24 hours (86400 seconds). After it expires, visiting this page will display the "Invitation invalid" page.


Notes

  • This interface always returns HTTP 200; different states are distinguished by the page content, and the unified JSON response format is not used.
  • AppDownloadURL is determined by the server-side configuration item server.app_download_url.
  • The interface has no cross-origin restrictions and can be accessed directly in a browser.
Didn't find what you need?Contact us,Talk to our engineers directly.

Request a Quote

Fill in the form and we will get back with a quote and proposal within 1 business day.

Click "Generate inquiry email" to open your mail client with the body pre-filled. If no mail client is configured, click "Copy" and paste it into webmail — recipient: sunshiyang@xstrive.com.