I'm trying use method RequestJWTApplicationToken
to authenticate and create a envelope, like the code below:
private OAuthToken _authToken;
protected static ApiClient _apiClient { get; private set; }
public string GetToken()
{
_authToken = _apiClient.RequestJWTApplicationToken(
"<ClientId>",
"<AuthServer>",
"<PrivateKeyBytes>",
1,
"<Scopes>");
}
public void SendDocumentForSignature()
{
var envelope = MakeEnvelope("my_email@domain.com", "my name");
var token = GetToken();
var apiClient = new ApiClient("https://demo.docusign.net/restapi");
apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + token);
var envelopesApi = new EnvelopesApi(apiClient);
EnvelopeSummary results = envelopesApi.CreateEnvelope("<AccountId>", envelope);
string envelopeId = results.EnvelopeId;
}
But I received the exception below, here envelopesApi.CreateEnvelope("<AccountId>", envelope);
:
Error calling CreateEnvelope: {"errorCode":"AUTHORIZATION_INVALID_TOKEN","message":"The access token provided is expired, revoked or malformed. Authentication for System Application failed."
I didn't find any use cases about the RequestJWTApplicationToken
method in the documentation or in the" Quick Start "project.
question from:
https://stackoverflow.com/questions/65924321/how-to-use-docusign-esign-client-apiclient-requestjwtapplicationtoken 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…