openProfile
import { openProfile } from "zmp-sdk";
API cho phép ứng dụng mở profile của User hoặc Official Account.
Ví dụ
Mở cửa sổ chat với người dùng:
await openProfile({
type: "user",
id: "user-id",
});
Mở profile của Official Account:
await openProfile({
type: "oa",
id: "oa-id",
});
Xem hướng dẫn xử lý lỗi và bảng mô tả chi tiết mã lỗi tại đây.
Tham số
Truyền tham số vào API dưới dạng object chứa các thuộc tính:
| Property | Type | Required | Description |
|---|---|---|---|
| type | "user" | "oa" | "aliasOA" | Yes | Nhận các giá trị sau:\nuser: Mở profile User.\noa: Mở profile OA.\naliasOA: Mở profile OA bằng Alias (field id truyền lên là alias của OA). |
| id | string | Yes | Id của User hoặc OA. |