Document Center
https://open-doc.dingtalk.com Nails Background configuration Create micro-application process:
Get Enterprise number corpid&secret: Login Nails OA Management background-micro-application-platform settings (only owners can view) application development process registered enterprises: into the OA management backstage, through a series of processes, the completion of enterprise registration. Create a micro-application: Enter the nail management background can enter the "Enterprise Application-Application Management" page to create micro-applications.
Need to fill in the application logo, application name, function introduction, home address and other required information. When you are done, you can find the enterprise under the "Work" tab of the Nail app, and you can view the micro-application portal.
Note: Home address must be true and effective, otherwise it will not be able to access the creation of micro-application can generate Agentid, convenient for subsequent development and use. Agentid can be used to avoid authentication, send enterprise session messages, and so on. Development of micro-applications:
Get the Corpid and Corpsecret of the Enterprise (OA background can be viewed) get the Accesstoken get js_ticket through the JSAPI get the free login code
Click on the small title link to the details address Application Demo Source
Download source
1. Configure Corpid and Corpsecret into Env.java
2. Use the IntelliJ Idea development tool to use Tomcat deployment engineering (see Idea to build a Web project)
3. Configure the address into a micro-application. Mobile End Development document
Please introduce the JS file on the page:
Http://g.alicdn.com/dingding/open-develop/1.5.1/dingtalk.js
Or
Https://g.alicdn.com/dingding/open-develop/1.5.1/dingtalk.js
The introduction of Dingtalk.js will get a global variable DD, support AMD, CMD introduction mode
NOTE:JS file versions address changes when you add upgrades, and if necessary (for example, to use the new JS-API), be aware of address changes at any time. However, the old version of JS files will always be available. Jsapi
Nail-nailed containers for H5 developers, nails provide some of the native capabilities of the JSAPI, these APIs are many of the basic capabilities of the mobile phone, these API calls do not need to be authentication (that is, do not need to dd.config), only to ensure that the call within the Dd.ready. For some nail-nail business-related, security-related API calls, we need the developer to do the authentication before invoking.
Correct use of JSAPI authentication
Dd.config ({
agentid: ",//must fill, Micro Application ID
corpid: ',//required, Enterprise ID
timeStamp:,//required, generate signature timestamp
noncestr: ',// Must fill, generate signed random string
signature: ',//must fill, signature
type:0/1,// optional. 0 represents the jsapi,1 of a micro-application to represent the Jsapi of a service window. Do not fill out the default of 0. This parameter is supported jsapilist from the Dingtalk.js version 0.8.3
: [' runtime.info ', ' biz.contact.choose ',
' Device.notification.confirm ', ' Device.notification.alert ',
' device.notification.prompt ', ' biz.ding.post ',
' Biz.util.openLink ']//required, need to use the Jsapi list, note: Do not bring DD.
});
Dd.ready (function () {
;
});
Dd.error (function (Error) {
/**
{
message: Error messages,//message information shows the parameters used by the spike server to generate the signature, and compare the parameters of the signature you generated. Find the wrong parameter
errorcode: "Error code"
}
**/
alert (' DD error: ' + json.stringify (err));
});
demo and Debugging Tools
We provide demo and debugging tools to facilitate your development, and if you have questions about the call parameters, use the Debugging tools. If you have questions about JSAPI usage, see demo.
Debugging Tools: http://wsdebug.dingtalk.com
After opening the hyperlink on the left, the mobile phone scans the two-dimensional code, and then configures the JSAPI parameters on the PC page, and then clicks on the phone to give the corresponding feedback.
Micro-Application Demo address: Https://github.com/outlookxie/app-todolist