釘釘SDK使用。


(1)到 https://open-doc.dingtalk.com/microapp/faquestions/vzbp02 下載SDK

(2)引入

using DingTalk.Api;
using DingTalk.Api.Request;
using DingTalk.Api.Response;

  

(3)獲取AccessToken

   string appkey = "dingt1s1h82ctf6wyy11";
        string appSec = "NKfjZJrNlZUIhcJPVURipXi9V6cduQcc5T5hBEJu5pyrWi7yCOVMGILtq6ELqU11";

        IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");

        OapiGettokenRequest req=new OapiGettokenRequest();

      
        req.Appsecret = appSec;
        req.Appkey = appkey;
        req.SetHttpMethod("GET");
     
        OapiGettokenResponse res = null;
        res = client.Execute(req);
        
        Response.Write(res.AccessToken);
       

  

 

DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970,1,1));
DateTime dtNow = DateTime.Parse("2019-7-31 ");
TimeSpan toNow = dtNow.Subtract(dtStart);
string timeStamp = toNow.Ticks.ToString();
timeStamp = timeStamp.Substring(0,timeStamp.Length - 7);
Response.Write(timeStamp);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM