docusignapidocusigncompositetmplts

"errorCode":"PARTNER_AUTHENTICATION_FAILED" when deployed in test server


I have successfully implemented and integrated Docusign in my application with the JWT grant which is perfectly working in the local server. Same application I deployed in the test environment server then I am getting below error.

Error while requesting server, received a non successful HTTP code 401 with response Body: '{"errorCode":"PARTNER_AUTHENTICATION_FAILED","message":"The specified Integrator Key was not found or is disabled. An Integrator key was not specified."}'

For the test server also should I need to make an app to go live in DocuSign or is there any option to test?

My requirement is like need endpoint developed in java Spring boot which will filter based on signer email and return remaining envelopes and this envelope list with be displayed in the mobile application. So for this, I have to deploy my spring boot application into the test server.

protected ApiClient createDocuSignApiClient() {
ApiClient apiClient = new ApiClient(this.docusignConfig.getBaseUrl());
try {
  val privateKeyBytes =
      FileCopyUtils.copyToByteArray(
          new FileSystemResource(this.docusignConfig.getPrivateKey()).getInputStream());
  List<String> scopes = new ArrayList<>();
  scopes.add(OAuth.Scope_SIGNATURE);
  val accessToken =
      apiClient.requestJWTUserToken(
          this.docusignConfig.getIntegrationKey(),
          this.docusignConfig.getUserId(),
          scopes,
          privateKeyBytes,
          3600);
  apiClient.setAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
  apiClient.setBasePath(this.docusignConfig.getBaseUrl());
  Configuration.setDefaultApiClient(apiClient);
} catch (ApiException | IOException exception) {
  LOG.error(exception.getMessage());
}
return apiClient;

}

#Docusign API
docusign.integration-key=xxxxxxxfc-7a73c309eccb
docusign.private-key=src/main/resources/private.key
docusign.user-id=dxxxxxxx-0c9253822c79
docusign.base-url=https://demo.docusign.net/restapi
docusign.account-id=x5e-d39f7ffaeec3xxxxxxxxxx
docusign.return-url=https://www.sample.com

These properties are set in application properties files by configuration properties @ConfigurationProperties appending values


Solution

  • The terms BasePath, BaseUri, and BaseUrl are confusing and are used inconsistently. When you call apiClient.setOAuthBasePath() this is a path, not a URL and it's the base path for the OAuth server, not the APIs.

    So the value you need to pass is "account-d.docusign.com" (or for production "account.docusign.com") and that is your issue here.