> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Redirect to a web app from a Work Notification

> Explains the prerequisites and steps for redirecting from a Work Notification to an H5 micro-app, so the app can connect notifications to in-app pages.

This document describes how to redirect to a DingTalk micro app by clicking a sent Work Notification.

## Prerequisites

Complete the [Create an app](/open/dingstart/create-application) procedure.

## Procedure

1. Select the target app, go to the app details page, and click **Basic Information** > **Credentials and Basic Information**.
2. Obtain the app Client ID and Client Secret.
3. Internal apps have the Work Notifications API permission enabled by default. You do not need to submit an application manually.
4. Obtain the access credential to get the access\_token of the internal app. When you call the API, the caller's identity is authenticated using the access token.
5. Call the [Send a Work Notification](/open/development/asynchronous-sending-of-enterprise-session-messages) API to send a Work Notification to the target user. The user needs to click the message to trigger the redirect, so the suitable message types are link messages, OA messages, and Card messages. For details, see [Message notification types](/open/development/message-types-and-data-format).

## Redirect to a web app (H5 micro app) by clicking a Work Notification

1. Call the [Send a Work Notification](/open/development/asynchronous-sending-of-enterprise-session-messages) API. Select link messages, OA messages, or Card messages as the format of the Work Notification. These three message types support redirection.
2. For how to construct the redirect link, see [Message link description](/open/development/message-link-description). The following examples show how to construct the link for each of the three message types. For the complete message sending format, see [Message notification types](/open/development/message-types-and-data-format).

   | **Parameter**   | Description                                                                                                                                                                                                                                                                                                                           |
   | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | corpid          | - For an internal app web app (H5 micro app), this parameter is the corpid value of the organization where the current micro app resides. - For a third-party enterprise app web app (H5 micro app), this parameter is the corpid value of the organization that has authorized the current app.                                      |
   | container\_type | The method used to open the link (fixed value): - **work\_platform**: Open the link in the workbench.                                                                                                                                                                                                                                 |
   | app\_id         | - For an internal app H5 micro app, set this parameter to 0\_agentId, which is composed of the digit 0, an underline, and the agentId. To view the agentId, see Agent ID. - For a third-party enterprise app H5 micro app, set this parameter to the appId value of the current third-party micro app. To view the appId, see App ID. |
   | redirect\_type  | In this scenario, set to **jump** (fixed value).                                                                                                                                                                                                                                                                                      |
   | redirect\_url   | The target URL to redirect to. It **must be urlEncoded**.                                                                                                                                                                                                                                                                             |

### Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
dingtalk://dingtalkclient/action/openapp?corpid=corpidOfEnterprise&container_type=work_platform&app_id=appId&redirect_type=jump&redirect_url=redirectUrl
```

### Example of constructing a redirect link for a link message

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
"messageUrl": "dingtalk://dingtalkclient/action/openapp?corpid=corpidOfEnterprise&container_type=work_platform&app_id=appId&redirect_type=jump&redirect_url=redirectUrl"
```

### Example of constructing a redirect link for an OA message

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
"message_url": "dingtalk://dingtalkclient/action/openapp?corpid=corpidOfEnterprise&container_type=work_platform&app_id=appId&redirect_type=jump&redirect_url=redirectUrl"
```

### Example of constructing a redirect link for a Card message

Card messages support the whole-card redirect ActionCard style and the independent-button redirect ActionCard style:

* Whole-card redirect ActionCard style

  ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  "single_url": "dingtalk://dingtalkclient/action/openapp?corpid=corpidOfEnterprise&container_type=work_platform&app_id=appId&redirect_type=jump&redirect_url=redirectUrl"
  ```
* Independent-button redirect ActionCard style

  ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  "action_url": "dingtalk://dingtalkclient/action/openapp?corpid=corpidOfEnterprise&container_type=work_platform&app_id=appId&redirect_type=jump&redirect_url=redirectUrl"
  ```
