docusign上线时如何设置主机变量,我不知道如何使用baseUrl [英] docusign what to set host variable when going live, I do NOT know how to use baseUrl

查看:63
本文介绍了docusign上线时如何设置主机变量,我不知道如何使用baseUrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将集成商密钥从模拟帐户(Jeff.Zhu@global.com)提升为真实帐户(accounts@ininin.com)。

I promoted integrator key from demo account (Jeff.Zhu@global.com) to live account (accounts@ininin.com) already.

我以此方式编程对于演示:

I programmed this way for demo:

$username = "Jeff.Zhu@global.com";
$password = "Pass2009";
$host = "https://demo.docusign.net/restapi";

$integrator_key = "4e8b9e67-8702-4e45-86de-f392fd5f19e2";

// create a new DocuSign configuration and assign host and header(s)
$config = new DocuSign\eSign\Configuration();
$config->setHost($host);
$config->addDefaultHeader("X-DocuSign-Authentication", "{\"Username\":\"" . $username . "\",\"Password\":\"" . $password . "\",\"IntegratorKey\":\"" . $integrator_key . "\"}");

上线后,我按以下方式更改登录名:

after going live, I change login as follows:

$username = "accounts@ininin.com";
$password = "Pass2009";
$host = "https://www.docusign.net/restapi";                

但是在进行此类更改后我的程序失败了,那怎么了?

But my program failed after I made such change, so what's wrong?

请帮助我。

有人告诉我使用baseUrl,但是程序中没有baseUrl。

I was told to use baseUrl, but there is no baseUrl in my program.

请帮帮我。

非常感谢

推荐答案

步骤如下:

1)一次发送到API的login_information端点以获取该帐户的baseUrl。

2)对于每个后续请求(发送)信封,检查状态等)使用返回的baseUrl(在解析后,它看起来像是 https:// na2 .docusign.net / restapi )。

因此,再次:

1)登录以获取baseUrl

2)对每个非登录调用使用新的baseUrl (发送信封等)

So, again:
1) Login to get baseUrl
2) Use new baseUrl for every non-login call (sending envelopes, etc.)

对于您的PHP代码,您已经完成了第一部分(进行登录调用)。您需要分析响应以获取baseUrl,然后使用正确的baseUrl重新运行 $ config-> setHost($ host)行。

For your PHP code, you have the first part done (making the login call). You need to parse the response to get the baseUrl, and then re-run the $config->setHost($host) line with the correct baseUrl.

您的代码在实时/生产环境中中断的原因是,模拟帐户都在demo.docusign.com上运行,而实时帐户可以在不同的baseUrls(na1, na2,eu1等)。

The reason that your code breaks in Live/production is that the demo accounts all run on demo.docusign.com, while Live accounts can run on different baseUrls (na1, na2, eu1, etc.).

有关工作示例,请参见 https://github.com/docusign/docusign-php-client#usage 并注意如何有两个 $ config-> setHost($ host)通话。

For a working example, see https://github.com/docusign/docusign-php-client#usage and notice how there are two $config->setHost($host) calls.

这篇关于docusign上线时如何设置主机变量,我不知道如何使用baseUrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆