docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 123 forks source link

API error after upgrading from v4.12.0 to v6.19.0: Invalid value specified for fontSize #231

Closed cnizzardini closed 3 weeks ago

cnizzardini commented 3 weeks ago

We are attempting to upgrade from docusign/esign-client version v4.12.0 to version v6.19.0 and have begun encountering a fontSize error. The value had initially been 5 but based on the comments in your code related to supported fontSizes I increased it to 7. Despite this, the error persists.

Sample code:

new \DocuSign\eSign\Model\DateSigned([
    'document_id' => $document_id,
    'recipient_id' => 1,
    'tab_label' => 'DateSignedTab',
    'anchor_string' => '/DateSigned/',
    'font_size' => 7,
    'anchor_y_offset' => -5,
])

Stacktrace:

2024-08-22 14:12:47 error: DocuSign\eSign\Client\ApiException: Error while requesting server, received a non successful HTTP code [400] with response Body:  O:8:"stdClass":2:{s:9:"errorCode";s:25:"INVALID_REQUEST_PARAMETER";s:7:"message";s:95:"The request contained at least one invalid parameter. Invalid value specified for fontSize: '7'";} in /var/www/staging4/vendor/docusign/esign-client/src/Client/ApiClient.php:344
Stack trace:
#0 /var/www/staging4/vendor/docusign/esign-client/src/Api/EnvelopesApi.php(4599): DocuSign\eSign\Client\ApiClient->callApi('...', '...', Array, '...', Array, '...', '...')
#1 /var/www/staging4/vendor/docusign/esign-client/src/Api/EnvelopesApi.php(4525): DocuSign\eSign\Api\EnvelopesApi->createEnvelopeWithHttpInfo('...', Object(DocuSign\eSign\Model\EnvelopeDefinition), NULL)
#2 /var/www/staging4/src/Utility/DocuSign/Client.php(97): DocuSign\eSign\Api\EnvelopesApi->createEnvelope('...', Object(DocuSign\eSign\Model\EnvelopeDefinition))
InbarGazit commented 3 weeks ago

Try something like this, I think it's a string, not an integer. You can see examples in https://www.docusign.com/blog/developers/tabs-deep-dive-font-styles "fontSize": "Size7" or "fontSize": "Size12" etc.

cnizzardini commented 3 weeks ago

That seems to have worked, the curious issue is that what we had in their previously indeed worked in the previous version.

InbarGazit commented 3 weeks ago

I don't know how to explain the past, but glad we have a plan for the future.