如何检索生产环境端点

时间:2017-05-15 16:36:48

标签: docusignapi

我上周认证了我的集成商密钥,并确认在上周五“实时”上线。 阅读this documentation,我现在需要确定我链接到哪个生产网站。问题是,当我按照说明操作时,我无法看到我链接到的网站:

*The {SERVER} value is determined by where your DocuSign Production account resides.
The easiest way to determine this is to login to your Production DocuSign account and
examine the prefix of the URL. For example, if the URL is:
https://na2.docusign.net/Member/Home.aspx, then replace {SERVER} with “na2” to find
your Production endpoints.

任何帮助将不胜感激

有没有办法从信封中检索生产URL?

envelopeApi.GetEnvelope() ?

1 个答案:

答案 0 :(得分:4)

使用Login_Information API检索您的BaseUrl。

以下是使用C# SDK

的代码
string _username = "<Add your User Name>";
string _password = "<Add your Password>";
string _integratorKey = "<Add your Integrator Key>";
string DOCUSIGN_URI = "https://www.docusign.net/restapi";
string _authHeader;

public string Init()
{
     _authHeader = "{\"Username\":\"" + username + "\", \"Password\":\"" + password + "\", \"IntegratorKey\":\"" + integratorKey + "\"}";
    // initialize client for desired environment (for production change to www)
    ApiClient apiClient = new ApiClient(DOCUSIGN_URI);
    Configuration.Default.ApiClient = apiClient;

    Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", _authHeader);

    // we will retrieve this from the login API call
    string accountId = null;

    /////////////////////////////////////////////////////////////////
    // STEP 1: LOGIN API        
    /////////////////////////////////////////////////////////////////

    // login call is available in the authentication api 
    AuthenticationApi authApi = new AuthenticationApi();
    LoginInformation loginInfo = authApi.Login();

    // parse the first account ID that is returned (user might belong to multiple accounts)
    accountId = loginInfo.LoginAccounts[0].AccountId;

    string baseUrl = loginInfo.LoginAccounts[0].BaseUrl;
    // Update ApiClient with the new base url from login call
    apiClient = new ApiClient(baseUrl);

    return accountId;
}