DingTalk web application deployment
This topic describes how to configure and deploy an Alibaba Cloud Chatbot as a web application in DingTalk and provides solutions to common issues.
Procedure
Create and configure a DingTalk application
A DingTalk administrator creates an application in the DingTalk Open Platform.

After you create the application, note the corpId, AppKey, and AppSecret from the application details. You will need this information later when you deploy the channel in Alibaba Cloud Chatbot.

In the DingTalk application, click Add Application Capability > Web Application to add a web application.

Configure the web application.
To get the standalone page deployment URL, in the chatbot space of the Alibaba Cloud Chatbot console, navigate to Deployment Channels > Service UI Deployment > Standalone Page Deployment.

After obtaining the URL, return to the Web Application settings in DingTalk. In the Application Homepage URL and PC Homepage URL fields, paste the standalone page deployment URL and append
&corpId=$CORPID$to the end of the URL. For example, if your standalone page deployment URL ishttps://chatbot.aliyuncs.com/intl/index.htm?locale=zh-CN&from=xxxx, enterhttps://chatbot.aliyuncs.com/intl/index.htm?locale=zh-CN&from=xxxx&corpId=$CORPID$in the fields.
In permission management, grant the following permissions to the application.

On the Version management and release page, create a new version and publish it.

Configure Alibaba Cloud Chatbot
In the chatbot space, navigate to Deployment Channels > Web Channel > Service UI Deployment > DingTalk H5 Page Deployment and click DingTalk Authorization Management.
Enter the corresponding information from your DingTalk application.

After you confirm, click Bind to Current Channel in the list.

Finally, click Deploy to apply the configuration to the specified environment.

Verify information retrieval
After you complete the steps above, you can find the application in your DingTalk workbench. The application displays the client-side page deployed for the channel. When a user interacts with the chatbot, the system passes their DingTalk account information as passthrough parameters.

The following table lists the passthrough parameters. Note: If a field is empty in a user's DingTalk profile, its value cannot be retrieved.
Parameter
Variable
Description
ding_name
name
Employee's name in the DingTalk organization.
ding_unionid
unionid
Employee's unique ID within the DingTalk organization.
ding_work_place
work_place
Workplace
ding_email
email
Email address
ding_dept_id_list
dept_id_list
Department ID list
ding_job_number
job_number
Employee ID
ding_hired_date
hired_date
Hire date
ding_title
title
Job title
ding_extension
extension
A custom field in DingTalk. For example, if a custom field is named "Custom", you can retrieve its value in the conversation flow by using the expression ${envVars['VENDOR_PARAM']['ding_extension']['Custom']}.
You can then use an API or a multi-turn conversation flow to perform custom actions based on this account information. The following example shows how to retrieve and display the user's account name. After you create and publish the conversation flow and the chatbot, when you enter an utterance for the corresponding intent in DingTalk, the chatbot displays the user's DingTalk account name.

In DingTalk, find the application and ask it a question. Verify that the response correctly includes the user information.

Other configurations
Configure Q&A perspectives
When the chatbot responds to a message, you may want to provide personalized answers based on the user's identity. By configuring different perspectives in your knowledge base, the chatbot can automatically select the appropriate answer for each user. To set a perspective for a specific user in DingTalk, follow these steps:
In the DingTalk admin console, go to Member Information Management and add a custom field.

Configure a perspective. For more information, see Perspective Management. Obtain the perspective code, for example,
FJnby7YfJf.In the DingTalk admin console, enter the perspective code for the user.
Method 1: Go to Member Management, select a member, and click More > Edit Member Information > Fill in More Information, then enter the Perspective code.

Method 2: Export member data in bulk, fill in the perspective code for each member, and then import the file.
FAQ
Q: Security verification and missing user information
A: When you configure the application in DingTalk, do not specify the server egress IP.









