Chuyển tới nội dung chính

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:

PropertyTypeRequiredDescription
type"user" | "oa" | "aliasOA"YesNhậ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).
idstringYesId của User hoặc OA.