我正在努力为Adobesign Integration创建测试应用程序。
当我尝试"尝试"页面中的呼叫(https://secure.na1.echosign.com/public/docs/restapi/restapi/v6#!/agreements/getSigningurl),我正在收到以下内容响应:
请求url
https://api.na2.echosign.com:443/api/rest/v6/agreements/cbjchbcaabaabaashxlhpnmlieua2pi3s7ewnid8yf8yf8qqqq4r/signingingurls
响应主体
{ "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,则它在失眠症中正常工作。什么会导致问题?
问题是您的ExecutePostTaskAsync调用正在将您的请求从Get To Post更改。将该行更改为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);