【发布时间】:2021-04-03 01:02:55
【问题描述】:
我正在尝试创建一个控制台程序,该程序从最后一天获取所有 Envelope EmailSubject。
我在同意方面遇到问题,并且不断收到错误消息:
DocuSign.eSign.Client.ApiException: '请求服务器时出错, 收到一个不成功的 HTTP 代码 Completed with response Body: {"error":"consent_required"}'
运行以下代码后我收到此消息:
var apiClient = new ApiClient();
string ik = _configuration.IntegrationKey;
string userId = _configuration.UserId;
string authServer = _configuration.AuthServer;
string rsaKey = DSHelper.ReadFileContent(DSHelper.PrepareFullPrivateKeyFilePath(_configuration.PrivateKeyFile));
OAuth.OAuthToken authToken = apiClient.RequestJWTUserToken(ik,
userId,
authServer,
Encoding.UTF8.GetBytes(rsaKey),
1);
我了解我需要使用此处的 DocuSign 管理门户步骤“同意内部应用程序”:How to obtain admin consent for internal applications/
但是,即使将我的应用程序添加到连接的应用程序列表后,我仍然会收到“{“error”:“consent_required”}”错误。
任何帮助将不胜感激!
【问题讨论】:
-
有多少用户会使用这个应用程序? userId 似乎来自配置?是固定的吗?意思是,它永远都是一样的?
-
类似的问题,可能有助于查看stackoverflow.com/questions/56989496/…
-
@InbarGazit 我试图没有用户。 UserId 实际上是 JSON 配置中的模拟 userId。我正在尝试构建一个每晚运行一次的程序,作为与一些计费软件的集成。我想在没有任何用户登录的情况下调用 API。
-
那么征得同意就很简单了,你只需要做一次,永远,让我在下面回答。
标签: c# docusignapi