Skip to main content

I am having no issues with the development environment; however, in production when I call the apiClient.requestJWTUserToken I’m getting back an error message.  “java.net.UnknownHostException: https”

CODE
    OAuthToken getToken(String apiClientUrl, String oAuthPath, 
            String clientId, String userId, 
            ArrayList<String> scopes, String keyValue) throws IllegalArgumentException, ApiException, IOException {
        ApiClient apiClient =this.getApiClient(apiClientUrl, oAuthPath);
        return apiClient.requestJWTUserToken(clientId, userId, scopes, keyValue.getBytes(), 3600);
    }

In dev the apiClient is using apiClientUrl = https://demo.docusign.net/restapi

the oAuthPath value is https://account-d.docusign.com

 

In production the apiClient is using apiClientUrl=https://www.docusign.net/restapi/v2.1

the oAuthPath value is https://account.docusign.com

I have verified the clientid, userid, scopes, and rsaPrivateKey values are correct.
I am able to ping account.docusign.com and www.docusign.net.

Am I using an incorrect url?   Any thoughts would be appreciated.

 

@Bruce C 

Your OAuth base path is wrong for the Java SDK. You’re passing a full URL. The SDK wants only the hostname.

Changing oAuthPath from https://account.docusign.com to account.docusign.com should resolve it.