# sendLink

## api.sendLink(options, threadId\[, type])

### Parameters

* options `SendLinkOptions`
* threadId `string`
* type `ThreadType?`
  * mặc định `ThreadType.User`

### Return

`Promise<SendLinkResponse>`

### Types

```typescript
export type SendLinkOptions = {
    msg?: string;
    link: string;
    ttl?: number;
};

export type SendLinkResponse = {
    msgId: string;
};
```

### Examples

```typescript
const options = {
    link: "https://example.com",
};

const threadId = "0000000000000000"

api.sendLink(
    options,
    threadId,
    ThreadType.Group
)
    .then(console.log)
    .catch(console.error);
```

### Related

* [ThreadType](https://tdung.gitbook.io/zca-js/models/enum)
