开发者社区> 问答> 正文

调用dd.biz.cspace.saveFile失败:not authorized

调用dd.biz.cspace.saveFile失败:errorcode:7,errormessage:not authorized

钉钉应用已添加钉盘权限,代码如下:

dd.config({ agentId: cfg.AgentID, // 服务端传来的congfig信息 corpId: cfg.CorpID, timeStamp: cfg.TimeStamp, nonceStr: cfg.NonceStr, signature: cfg.Signature, jsApiList: [ // 所有需要使用到的jsapi需要在config的时候进行注册,写在这里。 'runtime.info', 'biz.user.get', 'biz.contact.choose', 'biz.telephone.call', 'biz.ding.post', 'biz.cspace.saveFile', //钉盘存储 ] });

dd.ready(function () { //alert('dd ready! ' + cfg.CorpID); dd.biz.cspace.saveFile({ corpId: cfg.CorpID, url: fileUrl, // 文件在第三方服务器地址, 也可为通过服务端接口上传文件得到的media_id,详见参数说明 name: fileName, onSuccess: function(data) { if(data != null) resolve('OK'); else reject('保存文件结果不存在!'); }, onFail: function(err) { reject('保存文件失败:' + JSON.stringify(err)); } });

    });

展开
收起
梦熊 2020-10-22 14:37:57 1000 0
0 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Customer Success Dashboard GoD 立即下载
Data as a Service - 数据即服务 立即下载
Apache Wicket User Guide - Ref 立即下载