Closed DylanGD closed 3 years ago
@DylanGD what you refer as creating template is actually creating envelope. As such it will pick the default brand and owner for the account. If you really need to create new template you need to call
$results = $templates_api->createTemplate($args['account_id'], $template_req_object);
which resides in TemplatesApi.php and the function to do this is
createTemplateWithHttpInfo
Thanks for responding.
It's actually what I'm trying to do, I'm using the result of the $template_request
as parameter of the createTemplate()
method (exactly the process described in the example EG008CreateTemplate here :
$template_req_object = $this->make_template_req();
$results = $templates_api->createTemplate($args['account_id'], $template_req_object);
In this example, $this->make_template_req();
is returning a new EnvelopeTemplate()
Wich is similar of my example with specified brand_id / owner :
$template_request = new EnvelopeTemplate([
'documents' => [$document], 'email_subject' => "Please sign this document",
'envelope_template_definition' => $envelope_template_definition,
'recipients' => new Recipients([
'signers' => [$signer], 'carbon_copies' => [$cc]]),
'status' => "created",
'description' => "Example template created via the API",
'name' => $this->template_name,
'shared' => "false",
'brand_id' => "my_other_brand_id",
'owner' => $owner
]);
$templates_api->createTemplate('my_default_account_id', $template_request);
// ... brand_id / owner still default DS account data
Maybe I'm doing some shit
@DylanGD My apologies it wasnt clear the first time I red it. brand_id is properly set in my case. About the owner I need to clarify.
Update Template owner is always the user account used during the authentication ( Auth Code Grant or JWT ). Supplying owner object in the EnvelopeTemplate does not overwrite auth user as the owner
Hello @DylanGD, You cannot set the owner of the template, the owner set will be the default account Id. Here is the call documentation: https://developers.docusign.com/docs/esign-rest-api/reference/templates/templates/create/
Hi, I want to set a specified owner or brand_id when I create a new template, so I'm adding these specified values to the EnveloppeTemplate definiton but that actually not work, data are setted, but when the template is created without errors, brand_id is null and the owner is still the default DS account.
($userInfo data is retrieve from the getUsersApi()->callList() method)
If you have any ideas about this mistake. Thanks.