---
sourceType: api-reference
sourceTypeMatchedRule: api-prefix
slug: MA/api/zalo/openProfile
title: openProfile
---
```ts
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:

```ts showLineNumbers
await openProfile({
  type: "user",
  id: "user-id",
});
```

Mở profile của Official Account:

```ts showLineNumbers
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](/docs/MA/api/errorCode).

## 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:\n`user`: Mở profile User.\n`oa`: Mở profile OA.\n`aliasOA`: 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. |
