Ali im Instant messenger h5 demo

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.