# Open Feishu Approval 
Supported since Feishu version 7.3.0.
## Usage scenarios

In some scenarios, it is necessary to jump from the company's internal system or other mini programs to a specified page of Feishu Approval. At this time, you need to use applink to splice a page and call it in a reasonable scenario.

## Protocol

Feishu Approval uses the Applink to open the mini program protocol. For detailed information about AppLink, please refer to the document [Structure of AppLink](https://open.feishu.cn/document/uYjL24iN/ucjN1UjL3YTN14yN2UTN).

`https://applink.feishu.cn/client/mini_program/open`

## Parameters

**Field** | **Required** | **Description**                                      |
| ------ | ------ | ------------------------------------------- |
| appId  | Yes      | The application ID of the approval, the value is: <br> Feishu tenant `cli_9cb844403dbb9108`<br> Lark tenant `cli_9c7cc8a9a9edd105`. |
| path   | Yes      | The path and related parameters of the approval page to jump to. See below for details.                      |
| mode   | No      | Required only in sidebar mode, with the value `mode=sidebar-semi`.

### Explanation of path parameters

Approval page | Mobile page path | PC page path | Supports PC sidebar
---|---|---|---
Application initiation page | `pages/approval-form/index?id=${approval definition id}` | `pc/pages/create-form/index?id=${approval definition id}` | Not supported
Document details page | `pages/detail/index?instanceId=${approval instance id or instance code}` | `pc/pages/in-process/index?instanceId=${approval instance id or instance code}` | Supported, same as Mobile page path
Approval center page | `pages/approval-list/index?selectIndex=${corresponding list index}`<br>List index enumeration values:<br>- Pending approval `0`<br>- Approved `1`<br>- CC to me `2`<br>- Initiated `3` | `pc/pages/${list path}/index`<br>List path enumeration values:<br>- Pending approval `in-process`<br>- Approved `approved` <br>- CC to me `cc-2-me` <br>- Initiated `requested` | Not supported

- Method to obtain approval instance code: Call the [Batch Get Approval Instance ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) API to get it.

- Method to obtain approval definition id: Open the editing page of an approval through the approval management backend and get it from the URL link:

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/1181f19e5673410c7e99bc87686260ba_aodikEyzwG.png?height=1796&lazyload=true&maxWidth=640&width=3816)

## Opening methods

### Open in browser

To jump from the browser to the Feishu Approval application, you can directly route jump in the browser to the spliced applink address.
```js
const schema = 'https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9cb844403dbb9108&width=1136&height=750&path=pc%2Fpages%2Fin-process%2Findex'
<a href={schema} />
window.location.href = schema
window.open(schema)
```

### Mini program jump

To jump from a Feishu mini program to the Feishu Approval application, you need to use the client API [openSchema](https://open.larkoffice.com/document/client-docs/gadget/-web-app-api/navigation/openschema).
For example, to jump from another mini program to Feishu Approval and open the approval homepage:
```js
tt.openSchema({
    schema: "https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9cb844403dbb9108&width=1136&height=750&path=pc%2Fpages%2Fin-process%2Findex",
    external: true,
    success(res) {
      console.log(JSON.stringify(res));
    },
    fail(res) {
      console.log(`openSchema fail: ${JSON.stringify(res)}`);
    }
});
```

## Usage exampleswarning
- In actual scenarios, please replace the corresponding path, instanceId, and other parameters with actual values.
- For the specific page path, it must be URL encoded, such as: `pages/detail/index?instanceId=123`→`pages%2Fdetail%2Findex%3FinstanceId%3D123`.

### Mobile examples

#### **Open approval document details page**
```
https://applink.feishu.cn/client/mini_program/open?appId=cli_9cb844403dbb9108&path=pages%2Fdetail%2Findex%3FinstanceId%3D7418929504369377284
```

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/56e69d26d44be29c236af0be7ee39264_5NsQ0B5wo2.png?height=2532&lazyload=true&maxWidth=450&width=1170)

#### **Open approval form page (initiation page)**
```
https://applink.feishu.cn/client/mini_program/open?appId=cli_9cb844403dbb9108&path=pages%2Fapproval-form%2Findex%3Fid%3D7418928911667068932
```
![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/4164b87b7476fdeadbebfc95da43e91a_93SEZvZE05.png?height=2532&lazyload=true&maxWidth=450&width=1170)

#### **Open approval list**
```
https://applink.feishu.cn/client/mini_program/open?appId=cli_9cb844403dbb9108&path=pages%2Fapproval-list%2Findex%3FselectIndex%3D0
```
![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/de39c2abb2c79fadac47435cbeb38d99_xYrIvQuRc4.png?height=2532&lazyload=true&maxWidth=450&width=1170)

### PC examples

#### **Open approval center details page**
```
https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9cb844403dbb9108&path=pc%2Fpages%2Fin-process%2Findex%3FinstanceId%3D7418929504369377284
```
![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/a2d82cedb078f13647e69c47587ed495_LCrukuNhrX.png?height=2142&lazyload=true&maxWidth=700&width=2422)

#### **Open approval list**
```
https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9cb844403dbb9108&path=pc%2Fpages%2Fin-progress%2Findex
```
![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/51059b6993774e2bcd6de0fb5b5e29cf_GrpaRTOi5D.png?height=2142&lazyload=true&maxWidth=700&width=2422)

To open the approved approval list, you need to add the approved page path and reviewed parameter:
```
https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9cb844403dbb9108&path=pc%2Fpages%2Fapproved%2Findex%3Ftab_name%3Dreviewed
```
![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/5200963b770758eba046a6cb1de17976_cf2WStyb74.png?height=2142&lazyload=true&maxWidth=700&width=2422)

#### **Open approval form page (initiation page)**
```
https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9cb844403dbb9108&path=pc%2Fpages%2Fcreate-form%2Findex%3Fid%3D7418928911667068932
```
![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/4bfb1c23fe414a5836351eeb70cba2d5_I4gablTxeT.png?height=2142&lazyload=true&maxWidth=700&width=2422)

### PC sidebar/pager examples

#### **Open approval document details page**

**⚠️The sidebar needs to add the parameter mode=sidebar-semi, everything else is the same as the mobile end**:
```
https://applink.feishu.cn/client/mini_program/open?appId=cli_9cb844403dbb9108&mode=sidebar-semi&path=pages%2Fdetail%2Findex%3FinstanceId%3D7418929504369377284
```
![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/df1e7c52205d945322c5df97bf7d7b81_86qDOPlIAa.png?height=2142&lazyload=true&maxWidth=700&width=2422)
