Search code examples
c#apirestsharpechosign

AdobeSign: Getting Signing URL is returning NOT_FOUND response


I'm working on creating of test application for AdobeSign integration.

When I'm trying the call in "try it" page (https://secure.na1.echosign.com/public/docs/restapi/v6#!/agreements/getSigningUrl), I'm getting the following response:

Request URL

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

Response Body

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

But when I'm trying to get the same call working in c#, I'm getting resource not found response:

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

Here is my code:

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);

If I copy request URL when stepping through the code, it's working properly in Insomnia. What can cause the issue?


Solution

  • the issue is your ExecutePostTaskAsync call is changing your request from Get to Post. Change that line to 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);