AdobeSign:获取签名URL返回NOT_FOUND响应

时间:2019-03-04 20:00:12

标签: c# api restsharp echosign

我正在为AdobeSign集成创建测试应用程序。

当我在“尝试一下”页面(https://secure.na1.echosign.com/public/docs/restapi/v6#!/agreements/getSigningUrl)中尝试通话时,收到以下响应:

请求URL

https://api.na2.echosign.com:443/api/rest/v6/agreements/CBJCHBCAABAASHXLhpnMlIeuA2Pi3S7ewnID8yF8Qq4r/signingUrls

响应正文

{ "signingUrlSetInfos": [ { "signingUrls": [ { "email": "someaddress@somedomain.com", "esignUrl": "https://secure.na2.echosign.com/public/apiesign?pid=CBFCIBAA3AAABLblqZhDurMB28N5za2IxNYmueyExUE7WJa4rOkBdiLuIsl78c08sy12rbHyhu-3rh6BlpbI*&client_id=CBJCHBCAABAAjipHE56ILK-vpGLxT7lgDjXfeBYttICf" } ] } ] }

但是当我试图让相同的调用在c#中工作时,我得到的资源未找到响应:

{"code":"NOT_FOUND","message":"Resource not found"}

这是我的代码:

var client = new RestClient(adobesignURL + "/agreements/" + agreementID);
var request = new RestRequest("signingUrls", Method.GET);
request.AddHeader("Authorization", "Bearer " + adobesignIntegrationKey);
var resp = await client.ExecutePostTaskAsync(request);

如果我在遍历代码时复制请求URL,则它在失眠症中正常工作。是什么原因引起的?

1 个答案:

答案 0 :(得分:1)

问题是您的ExecutePostTaskAsync调用将您的请求从“获取”更改为“发布”。将该行更改为ExecuteTaskAsync。

var client = new RestClient(adobesignURL + "/agreements/" + agreementID);
var request = new RestRequest("signingUrls", Method.GET);
request.AddHeader("Authorization", "Bearer " + adobesignIntegrationKey);
var resp = await client.ExecuteTaskAsync(request);