For those who do not want to install background environment, with NODEJS to build the server.
The following is an example of a node request from the official website:
Found a ali-top-sdk instead of topclient.
The sample code is then requested as follows:
Topclient = require (' ALI-TOP-SDK ') ). Topclient; varClient =Newtopclient ({' Appkey ': ' Your Appkey ' , ' Appsecret ': ' Your Appsecret ' , ' Rest_url ': ' Gw.api.taobao.com/router/rest '}); Client.execute (' Taobao.openim.users.get ' , { ' UserIDs ': ' 18500000000 '}, function(Error, response) {if(!error&&count==0) {console.log (Response.userinfos); Console.log ("-----------------------------"); Count++; } Else if(!error&&count!=0){} ElseConsole.log (Error);});
The current process is:
1. Add Users with Users.add
2. Query users with Get
3. Update user information with update
Once you've added it, you're ready to access kit.
wkit.init ({ uid:' lhx ' , // [String] user required to log in Nick Appkey : ' Your Appkey ' , //[Int] appkey //[String] user Password required for login (via [Taobao.openim.users.add] (//open.taobao.com/doc2/apidetail.htm?apiid=24164) Imported password field) touid: ' wyc ' //[String] need to chat with Nick });
--------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------
Document Address:
Ali im H5 Kit integration documentation online Address:
http://baichuan.taobao.com/docs/doc.htm?spm=a3c0d.7629140.0.0.d53rkn&treeid=41&articleid=103361& Doctype=1
API Online Test Address:
http://open.taobao.com/apitools/apitools.htm?spm=a219a.7395905.0.0.vw3jnl&catid=20654&apiid=24157& apiname=taobao.openim.users.get&scopeid=#
OPENIMAPI Address:
http://open.taobao.com/docs/api.htm?spm=a219a.7395905.0.0.UNskDy&apiId=24157
Thanks to Leoliew for the ali-top-client NPM package
Ali im Instant messenger h5 demo