Created
February 9, 2018 05:50
-
-
Save Ergin008/e4c538f2bc1190a05e960e6de4ff5a0c to your computer and use it in GitHub Desktop.
Get your DocuSign account's base URI and configure api client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AuthenticationApi authApi = new AuthenticationApi(apiClient); | |
LoginInformation loginInfo = authApi.login(); | |
// note that the user might belong to multiple accounts, here we simply get first | |
String accountId = loginInfo.getLoginAccounts().get(0).getAccountId(); | |
String baseUrl = loginInfo.getLoginAccounts().get(0).getBaseUrl(); | |
// important: below code is required for production as the account sub-domains vary in the | |
// live system. We strip the base URI down to the form https://{env}.docusign.net/restapi | |
// then re-configure the api client with the new base path | |
String[] accountDomain = baseUrl.split("/v2"); | |
apiClient.setBasePath(accountDomain[0]); | |
Configuration.setDefaultApiClient(apiClient); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment