调用create_envelope api会显示INVALID_USERID错误

问题描述 投票:0回答:1

我正在使用

token = api_client.request_jwt_user_token(client_id=self.integration_key, user_id=self.user_id,
        expires_in=3600,
        oauth_host_name=self.oauth_host_name,
        private_key_bytes=private_key,
        scopes=(OAuth.SCOPE_SIGNATURE, OAuth.SCOPE_IMPERSONATION))
user_info = api_client.get_user_info(token.access_token)

成功检索访问令牌,并且当我使用创建和发送信封时,我也成功获得了基本uri。

envelopes_api = EnvelopesApi(self.init_client())
welcome_letter_env = self._populate_template(template_id, signer_name, signer_email, subject, text_tabs, checkbox_tabs, radio_tabs)
results = envelopes_api.create_envelope(self.account_id, envelope_definition=welcome_letter_env)

我收到INVALID_USERID错误。请注意,完全相同的代码对于模拟帐户也可以正常使用,这仅在生产帐户中发生。

docusignapi
1个回答
0
投票
您需要将base_uri设置为您帐户的正确值。

查看/ oauth / userInfo调用的结果。

例如:

api_client = ApiClient() api_client.host = base_path #### Setting the base path api_client.set_default_header("Authorization", "Bearer " + args["ds_access_token"]) envelope_api = EnvelopesApi(api_client) results = envelope_api.create_envelope(args["account_id"], envelope_definition=envelope_definition)

© www.soinside.com 2019 - 2024. All rights reserved.