Get Documents Signed via Email By Using Adobe Sign API

161 Views Asked by At

I'm using Asp.net MVC, The problem I'm facing is that I have to send a pdf by email to get signed by the customer. Now I've done this by using DocuSign. But the Client's requirement is to send the document using Adobe Sign. Now, I need to generate an access token in the code, but the response I'm getting is "401 Unauthorized" even though my credentials are correct. (If I generate an access token from the adobe sign website and use it in my code, Works fine. But that token expires in 1 hour)

string clientId = "**********";
string clientSecret = "*************";

var tokenUrl = "https://secure.na3.adobesign.com/oauth/v2/token";

var tokenRequestBody = new Dictionary<string, string>
{
    {"client_id", clientId},
    {"client_secret", clientSecret},
    {"grant_type", "client_credentials"},
    {"scope", "user_read user_write user_login agreement_read agreement_write agreement_send library_write widget_write library_read widget_read"}
};

var tokenResponse = await client.PostAsync(tokenUrl, new FormUrlEncodedContent(tokenRequestBody));
if (tokenResponse.IsSuccessStatusCode)
{

I can't get into this block of code cuz of the response '401 Unauthorized'.

0

There are 0 best solutions below