New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dingtalk_suite

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dingtalk_suite

钉钉套件主动调用api

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

dingtalk suite

钉钉套件主动调用api, 自带缓存。

回调server API见:dingtalk_suite_callback ##安装 npm install dingtalk_suite ##示例 构造函数:

var dd_talk = require('dingtalk_suite');
var conf = {
    suiteid: 'suitexpiygdnz51hsbbhj',
    secret: 'C1oXyeJUgH_QXEHYJS4-Um-zxfv_yGSpTs3Yq6un6UV_zAlEpt-6np3fXskv5dGs',
    getTicket: function(callback){ 
      //从数据库中取出Tikcet,返回的data样式为:{value: 'xxxxxxx', expires:1452735301543}
      //ticket从 dingtalk_suite_callback 处获得
      callback(null, data);
    },
    getToken: function(callback){
      //从数据库中取出Token,返回的data样式为:{value: 'xxxxxxx', expires:1452735301543}
      callback(null, data);
    },
    saveToken: function(data, callback){
      //存储Token到数据库中,data样式为:{value: 'xxxxxxx', expires:1452735301543//过期时间}
      callback(null);
    }
  }
var api = new dd_talk(conf);

:本项目自带cache, token的过期时间默认为1小时59分50秒(防止网络延迟,故比规定2小时少了10秒)。 可以在conf.token_expires_in更改(不可大于2小时)。 ##方法

获取企业号永久授权码

api.getPermanentCode(tmp_auth_code, callback)
//tmp_auth_code字符串,由 dingtalk_suite_callback 处获得。

获取企业号Token

//auth_corpid和permanent_code由上面接口获得。
api.getCorpToken(auth_corpid, permanent_code, callback)

获取企业号信息

api.getAuthInfo(auth_corpid, permanent_code, callback)

获取企业号应用

api.getAuthInfo(agentid, auth_corpid, permanent_code, callback)

激活授权套件

api.activateSuite(auth_corpid, permanent_code, callback)

ISV为授权方的企业单独设置IP白名单

//ip_whitelist为数组格式:["1.2.3.4","5.6.*.*"]
api.setCorpIpwhitelist(auth_corpid, ip_whitelist, callback)

##钉钉文档 http://ddtalk.github.io/dingTalkDoc/?spm=a3140.7785475.0.0.p5bAUd#1-isv接口调用整体流程

Keywords

FAQs

Package last updated on 14 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc