docusignapi - C# 中有没有办法知道 DocuSign API 调用限制?
问题描述
我想以编程方式监控 DocuSign API 调用限制。我想知道是否有办法在 C# 中做到这一点。
解决方案
是的,有,但这不是一个明显的方法。
您需要分析来自 http 调用的响应标头。
ApiResponse<EnvelopeSummary> results = envelopesApi.CreateEnvelopeWithHttpInfo(accountId, envelopeDefinition);results.Headers.TryGetValue("X-RateLimit-Remaining", out string remaining);
ApiResponse<EnvelopeSummary> results = envelopesApi.CreateEnvelopeWithHttpInfo(accountId, envelopeDefinition);
results.Headers.TryGetValue("X-RateLimit-Reset", out string reset);
Console.WriteLine("API calls remaining: " + remaining);
Console.WriteLine("Next Reset: " + reset); // Unix timestamp
此博客文章中的更多详细信息 - https://www.docusign.com/blog/dsdev-from-the-trenches-working-with-headers-in-docusign-sdks/
(我假设您的意思是实时值,而不是帐户级别设置。您也可以获取后者,让我知道)
推荐阅读
- python - 在 IBM Cloud Functions 中安装 opencv
- flutter - 块库空
- pug - 如何在 pug 中添加 css 文件链接
- flutter - 如何在颤动中将颜色应用于多色 svg?
- mysql - Mysql JSON EXTRACT 不适用于大键
- javascript - 等待 3rd 方插件 $(...).click() AJAX 调用完成
- javascript - 如何检查是否从 Web 浏览器安装了应用程序?
- html - 网格元素不会垂直拉伸
- json - 从 json 文件中读取特定对象的一个值
- python - 使用 tensorflow/pytorch 进行土地预测的多波段图像