Giter Site home page Giter Site logo

docusign / docusign-esign-php-client Goto Github PK

View Code? Open in Web Editor NEW
196.0 31.0 123.0 7.84 MB

The Official DocuSign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.

Home Page: https://www.docusign.com/devcenter

License: MIT License

PHP 100.00% Shell 0.01%

docusign-esign-php-client's Introduction

The Official DocuSign eSignature PHP Client SDK

Build status

Requirements

Compatibility

  • PHP 7.4+

Installation

This SDK is provided as open source, which enables you to customize its functionality to suit your particular use case. To do so, download or clone the repository. If the SDK’s given functionality meets your integration needs, or if you’re working through our code examples from the DocuSign Developer Center, you merely need to install it by following the instructions below.

Composer:

  1. In your PHP console, type: Composer require docusign/esign-client;
  2. To use the package automatically, add to Composer's Autoload file: require_once('vendor/autoload.php');

Manual install:

  1. Download or clone this repository.
  2. Bind the PHP SDK to your server or place it in a static location.
    1. To bind to your server, edit the init.php file. Add:
      require_once('/path/to/docusign-esign-client/autoload.php');
    2. To bind to single pages: In your PHP file that will utilize the PHP SDK, add:
      require_once('/path/to/docusign-esign-client/autoload.php');
  3. If you are using Composer V2 and get the error 'namespace cannot be found', add the following class mapping in the composer.json file.
  4. "autoload": { "classmap": [ "/path/to/docusign-esign-client/src" ] }

Dependencies

This client has the following external dependencies:

Code examples

You can find on our GitHub a self-executing package of code examples for the eSignature PHP SDK, called a Launcher, that demonstrates common use cases. You can also download a version preconfigured for your DocuSign developer account from Quickstart. These examples can use either the Authorization Code Grant or JSON Web Token (JWT) authentication workflows.

OAuth implementations

For details regarding which type of OAuth grant will work best for your DocuSign integration, see Choose OAuth Type in the DocuSign Developer Center.

For security purposes, DocuSign recommends using the Authorization Code Grant flow.

Support

Log issues against this client through GitHub. We also have an active developer community on Stack Overflow.

License

The DocuSign eSignature PHP Client SDK is licensed under the MIT License.

Additional resources

docusign-esign-php-client's People

Contributors

4c0n avatar aburov-dev avatar acooper4960 avatar arvinsingla avatar asif-docusign avatar ccorliss avatar dbbrahmbhatt avatar dwhite-nep avatar eleanorharris avatar emarchak avatar ergin008 avatar garg-mudit avatar gsnavin avatar harsharahul avatar hobbyprojects avatar inbargazit avatar jekar avatar jlbooker avatar jwimberley-ds avatar kenharris avatar larrykluger avatar larryklugerds avatar mattkingds avatar mmallis87 avatar nicholasareed avatar ohda avatar shijun avatar valkan07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docusign-esign-php-client's Issues

V2 Fatal Error when resending envelope

My environment is currently limited to PHP 5.5.9 so I'm attempting to put V2 of this software into production. (Composer requires 5.5.36 to install v3).

When I attempt to resend an envelope, I run into errors with ObjectSerializer:

$envelopeApi = new DocuSign\eSign\Api\EnvelopesApi($apiClient);

$updateOptions = new DocuSign\eSign\Api\EnvelopesApi\UpdateOptions();
$updateOptions->setResendEnvelope("true");

$update_summary = $envelopeApi->update($account_id, $env_id, $updateOptions);
PHP Fatal error:  Access to undeclared static property: DocuSign\eSign\Api\EnvelopesApi\UpdateOptions::$swaggerTypes in .../vendor/docusign/esign-client/src/ObjectSerializer.php on line 68

Any help would be appreciated!

EnvelopesAPI getDocument method signature order change in v3

The order for $document_id and $envelope_id has changed for EnvelopesApi->getDocument between versions:

V2
public function getDocument($account_id, $envelope_id, $document_id)

V3
public function getDocument($account_id, $document_id, $envelope_id, EnvelopesApi\GetDocumentOptions $options = null)

Any particular reason why these two have been interchanged? Please let me know if this wasn't intentional and I can create a pull request for the fix.

Thanks.

time out error

Cannot update a property to Null value

When the SDK is calling the API for an update, only the properties that are set with a not null value are exported.
This lead to an issue => No way to update a property to a NULL value.

I was trying to switch an embded signer to remote by unsetting the user_client_id but i'am stuck.

Serializer issue: Class '\DocuSign\eSign\Model\array' not found

When I add a Dropdown on the DocuSign template and try to get the template details using api method

docusignapi-error1

$templateApi = new DocuSign\eSign\Api\TemplatesApi($this->getApiClient()); $oEnvelopeTemplate = $templateApi->get($this->getAccountId(), $rs_template_id);

I get the error

Fatal error: Class '\DocuSign\eSign\Model\array' not found in \esign-client\src\ObjectSerializer.php on line 281

v4.0.0 Incorrect ApiException exception references

ApiException class was moved, however references/phpdocs throughout the code do not point to the new location.

e.g.
\DocuSign\eSign\Client\ApiException is referenced in many places as \DocuSign\eSign\ApiException which my editor PHPStorm complains about it not existing.

I also noticed that the PHP code is not to PHP best practices in places.
I would recommend using phpstan to scan the code: https://github.com/phpstan/phpstan

Call to a member function read() on string in ObjectSerializer.php:285

I get this error whenever i run the EnvelopeApi\getDocument method. It seems that the $data being passed to the deserialize function is a string.

I managed to get it to work by changing line 285-287 to

if(is_string($data)){
    fwrite($file, $data);
}
else{
    while ($chunk = $data->read(200)) {
        fwrite($file, $chunk);
    } 
}

Unfortunately; this change is always removed when we deploy to our servers

Class EnvelopesApi\CreateEnvelopeOptions() Not found with composer

Hi,

I'm posting this here, but it could be composer related. Including the docusign eSign client via composer on a fresh Syfmony 3 install was giving me an error of:

Class EnvelopesApi\CreateEnvelopeOptions() not found

Despite the fact that the class was correctly spelled. (Copied from another working project). Changed composer version to the same that was used on the other project with no avail. Removed all vendors and .lock file, with compose clear-cache and did a fresh install, the problem persisted. (on both versions of composer)

Composer version 1.3.1 & 1.4.3 same issues.

All other Docusign Classes where autoloaded correctly.

Finally got it working using:

composer dump-autoload --optimize

Please let me know what other information could be required for debugging ? or if this should be directed to composer

No ability to indicate TLS version

My company was just contacted by someone from DocuSign indicating that DocuSign is moving away from TLS 1.0 to TLS1.2. However, there is no way to set this in the Configuration and no way to set it in a curl config file. Can a new config setting be introduced to allow passing the CURLOPT_SSLVERSION setting? (i.e. CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_TLSv1_2)

[v5.1.0] Class '\DocuSign\eSign\Model\DateTime' not found

Hi, Seems that the SDK has errors right now, something to do with DateTime ...

trace:

#0 vendor/docusign/esign-client/src/ObjectSerializer.php(236): DocuSign\eSign\ObjectSerializer::deserialize(Object(stdClass), '\\DocuSign\\eSign...', NULL)
#1 vendor/docusign/esign-client/src/ObjectSerializer.php(291): DocuSign\eSign\ObjectSerializer::deserialize(Array, '\\DocuSign\\eSign...', NULL)
#2 vendor/docusign/esign-client/src/ObjectSerializer.php(291): DocuSign\eSign\ObjectSerializer::deserialize(Object(stdClass), '\\DocuSign\\eSign...', NULL)
#3 vendor/docusign/esign-client/src/ObjectSerializer.php(236): DocuSign\eSign\ObjectSerializer::deserialize(Object(stdClass), '\\DocuSign\\eSign...', NULL)
#4 vendor/docusign/esign-client/src/ObjectSerializer.php(291): DocuSign\eSign\ObjectSerializer::deserialize(Array, '\\DocuSign\\eSign...', NULL)
#5 vendor/docusign/esign-client/src/Api/TemplatesApi.php(5743): DocuSign\eSign\ObjectSerializer::deserialize(Object(stdClass), '\\DocuSign\\eSign...', Array)
#6 vendor/docusign/esign-client/src/Api/TemplatesApi.php(5651): DocuSign\eSign\Api\TemplatesApi->listRecipientsWithHttpInfo('5c5ac154-2a7e-4...', 'cfc2e3a5-0032-4...', Object(DocuSign\eSign\Api\TemplatesApi\ListRecipientsOptions))
#7 Docusign/EnvelopeGenerator.php(162): DocuSign\eSign\Api\TemplatesApi->listRecipients('5c5ac154-2a7e-4...', 'cfc2e3a5-0032-4...', Object(DocuSign\eSign\Api\TemplatesApi\ListRecipientsOptions))

Checkbox $tabGroup->setMaximumAllowed('1') not working

Seems $tabGroup->setMaximumAllowed('1') is not working as expected. I can still select both checkboxes in the online signing ceremony.

I built this solution from this example on stackoverflow:
https://stackoverflow.com/a/58210277/11475075

// Tab Group for linking the Checkboxes
$tabGroup = new TabGroup();
$tabGroup->setGroupLabel(self::CHECKBOX_GROUP);
$tabGroup->setGroupRule('SelectAtLeast');
$tabGroup->setMinimumRequired('0');
$tabGroup->setMaximumAllowed('1'); # this is not working!
$tabGroup->setValidationMessage('Please check one box should you wish to opt-in');
$tabGroup->setTabScope('Document');
$tabGroup->setPageNumber('7');
$tabGroup->setDocumentId('1');
$tabGroup->setRecipientId('2');

Output:

"checkboxTabs": [
    {
        "documentId": "1",
        "pageNumber": "7",
        "recipientId": "2",
        "tabGroupLabels": [
            "CheckboxGroup"
        ],
        "tabLabel": "CheckBox Option 1",
        "xPosition": "80",
        "yPosition": "321"
    },
    {
        "documentId": "1",
        "pageNumber": "7",
        "recipientId": "2",
        "tabGroupLabels": [
            "CheckboxGroup"
        ],
        "tabLabel": "CheckBox Option 2",
        "xPosition": "80",
        "yPosition": "336"
    }
],
"tabGroups": [
    {
        "documentId": "1",
        "groupLabel": "CheckboxGroup",
        "groupRule": "SelectAtLeast",
        "maximumAllowed": 1,
        "pageNumber": "7",
        "recipientId": "2",
        "tabScope": "Document",
        "validationMessage": "Please check one box should you wish to opt-in"
    }
],

Fatal error: Class 'DocuSign\eSign\Api\EnvelopesApi\ListStatusChangesOptions' not found

Dear Devs,

Composer can't load the subject class.
Please generate separate php files per namespaces/classes in under proper directory path.

<?php
require 'vendor/autoload.php';

$options = new DocuSign\eSign\Api\EnvelopesApi\ListStatusChangesOptions();
// results: Fatal error: Uncaught Error: Class 'DocuSign\eSign\Api\EnvelopesApi\ListStatusChangesOptions' not found in ...

The class in the file src/Api/EnvelopesApi.php instead of src/Api/EnvelopesApi/ListStatusChangesOptions.php regarding to its namespace.
Relating docs to your psr-4 composer setting: http://www.php-fig.org/psr/psr-4

Best regards,
Karoly

ObjectSerializer opens SplFileObject with write-only permissions

The ObjectSerializer opens the SplFileObject instance with write-only permissions. This makes doing any further operations on the file very difficult and usually requires re-opening the SplFileObject with a new instance.

If would be beneficial is the new instance of SplFileObject was changed from (ObjectSerializer:265):

$deserialized = new \SplFileObject($filename, "w");

to

$deserialized = new \SplFileObject($filename, "w+");

Making it capable of rewinding and reading from the same SplFileObject instance.

Example use of LoginInformation fails on Count()

While the library itself seems to work with PHP 7.2, the use of count() on an instantiation of LoginInformation fails. The fix is to implement the Countable interface on LoginInformation:

      class LoginInformation implements ArrayAccess, \Countable

And then add a count method in the class to access container:

      public function count() 
     { 
            return count($this->container); 
      }    

Serializer issue.

When i try to call
$templateApi = new \DocuSign\eSign\Api\TemplatesApi($apiClient);
$template = $templateApi->get($accountId, '[id-template]');

I've got this error
Fatal error: Class 'Number' not found in _vendors/docusign/esign-client/src/ObjectSerializer.php on line 274

Looks like the serializer is waiting for number and not Number. (ObjectSerializer.php line 254)

Edit : Pull request #46 and #41 try to fix that issue already.
Duplicate issue with #48

testConfig vs TestConfig

Hello,

You have a testConfig.php and a TestConfig.php inside the tests folder.
I may generate issues on windows/unix...

Syntax error in FoldersAPI, line 321

Error message:
syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING) in C:\Users\Kun\Documents\octesys\vendor\docusign\esign-client\src\Api\FoldersApi.php on line 321

list is a PHP reserved keyword; it can't be used as a method name unless you're running PHP 7.

Contribution/Building instructions

Hi,

I and perhaps others would like to contribute to this library. However there are no instructions with regards to building a new version of this package.

Could you please provide/document how to generate/build this package?

In the comments I saw that the classes have been generated using swagger-codegen. I have tried to generate the same classes as in this library using swagger-codegen-cli however the classes I get are quite different from the ones in this library (They depend on Guzzle instead of cURL and I suppose we need cURL instead of Guzzle for BC?).

Maybe it is related to the version of swagger-codegen?

Anyway something like https://help.github.com/en/articles/setting-guidelines-for-repository-contributors would be highly appreciated along with some information on how to build this package.

Also it would be interesting to know more about the timeline with regards to supporting older PHP versions. Currently the docs state that PHP 5.4 and higher is supported. Officially even PHP 7.1 is not even actively supported anymore: https://www.php.net/supported-versions.php
So maybe at some point in the near future this package can drop support for PHP 5.x?

Thanks in advance for your time and effort.

Error installing with composer

Failed to execute unzip -qq  '/Users/username/projects/vendor/docusign/esign-client/23a7f5708e3ef7cac0e30bbdabcc91fd' -d '/Users/username/projects/vendor/composer/73a8a353'

replace /Users/username/projects/vendor/composer/73a8a353/docusign-docusign-php-client-bf4c4af/test/testConfig.php? [y]es, [n]o, [A]ll, [N]one, [r]ename: NULL
(EOF or read error, treating as "[N]one" ...)

The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
Unzip with unzip command failed, falling back to ZipArchive class

GetDocument without writing to file for PCI compliance

Hi,

This is really just a suggestion for a possible feature that would be nice. When I use getDocument it creates a file in /tmp. This file could potentially have client sensitive information and with most merchant accounts this should not be saved on a hard rive. I would suggest it would be helpful to be able to getDocument and get the document bytes in a string that could then be manipulate as needed, without having to clean up a file in /tmp.

Just a thought as I build my docusignapi scripts.

T

DocuSign populating template fields not working

I am trying to take one of our tenplates saved in docusign and create en envelope with some Tabs pre-populated, but they keep turning up blank. What am I doing wrong?

Here's my API Call:

POST https://demo.docusign.net/restapi/v2/accounts/*********/envelopes HTTP/1.1

Accept: application/json
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,fa;q=0.6,sv;q=0.4
Cache-Control: no-cache
Origin: https://apiexplorer.docusign.com
Referer: https://apiexplorer.docusign.com/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Authorization: Bearer eyJ0eXAiOiJNVCIsImFsZyI6IlJTMjU2Iiwia2lkIjoiNjgxODVmZjEtNGU1MS00Y2U5LWFmMWMtNjg5ODEyMjAzMzE3In0.AQkAAAABAAUABwAAnnShjF7VSAgAAN6Xr89e1UgCAPUDGkyQm1dBup7evMP9LjwNACQAAAA3Y2ZlMzUzZC1jOTFjLTQzMmUtOWE5MC02ZWYwMDFmN2JhN2EVAAEAAAASAAAAAAAYAAEAAAAFAAAAIAAAoCtj9F3VSA.LMVQ1R7MMGDbOn8d5qrPx-4Ovk7lJUgyUYv__INfOzfhCBgLHSv8o5fLhASt_wQAB9btmdr3oez12JsR2gpyLm8ku57bwOI8s_0mJWQCAqT5EMo1pnys68ZbjF_jLQsmpRtWjWyaE4axpU9hz0vU3bu4X7wF8Fb0lQhYjGCmAhV-uAT9s08OD4DUf14bti5rWHaLZ5ikdr8RfAOuqaEk8OUkxJHgLmd9DsDJDDXEnGsHvWOYVcMToY61d63eUMWWakTOqJD5PFPiHsVnlTNZbh2XQGe7tCCjhI4iIniVMwlaN8lDiHTnuL8LnpCRkT3gZRo90iw5rTRDbR8JTB2AYA
Content-Length: 517
Content-Type: application/json

{
  "emailSubject": "templateTest",
  "status": "sent",
  "templateId": "d2115bd5-d13e-42b8-ae57-d914ecdcd215",
  "templateRoles": [
    {
      "email": "[email protected]",
      "name": "Barnet Neff",
      "roleName": "Customer",
      "tabs": {
        "textTabs": [
          {
            "documentId": "1",
            "pageNumber": "1",
            "tabLabel": "test",
            "value": "Template One",
            "xPosition": "0",
            "yPosition": "0"
          }
        ]
      }
    }
  ]
}

If it helps, here is the tab object in question (its a simple text tab):

  protected 'container' => 
    array (size=48)
      'anchor_case_sensitive' => null
      'anchor_horizontal_alignment' => null
      'anchor_ignore_if_not_present' => null
      'anchor_match_whole_word' => null
      'anchor_string' => null
      'anchor_units' => null
      'anchor_x_offset' => null
      'anchor_y_offset' => null
      'bold' => string 'false' (length=5)
      'conceal_value_on_document' => string 'false' (length=5)
      'conditional_parent_label' => null
      'conditional_parent_value' => null
      'custom_tab_id' => null
      'disable_auto_size' => string 'false' (length=5)
      'document_id' => string '1' (length=1)
      'error_details' => null
      'font' => string 'lucidaconsole' (length=13)
      'font_color' => string 'black' (length=5)
      'font_size' => string 'size9' (length=5)
      'formula' => null
      'height' => int 11
      'is_payment_amount' => string 'false' (length=5)
      'italic' => string 'false' (length=5)
      'locked' => string 'false' (length=5)
      'max_length' => int 4000
      'merge_field' => null
      'name' => null
      'original_value' => string '' (length=0)
      'page_number' => string '1' (length=1)
      'recipient_id' => string '89060912' (length=8)
      'require_all' => string 'false' (length=5)
      'required' => string 'true' (length=4)
      'require_initial_on_shared_change' => string 'false' (length=5)
      'sender_required' => null
      'shared' => string 'false' (length=5)
      'status' => null
      'tab_id' => string 'fa9df7b1-95c5-4bb4-8c9e-fbc5ce953ca6' (length=36)
      'tab_label' => string 'test' (length=4)
      'tab_order' => null
      'template_locked' => string 'false' (length=5)
      'template_required' => string 'false' (length=5)
      'underline' => string 'false' (length=5)
      'validation_message' => string '' (length=0)
      'validation_pattern' => string '' (length=0)
      'value' => string '' (length=0)
      'width' => int 84
      'x_position' => string '198' (length=3)
      'y_position' => string '339' (length=3)

Creating Embed Request Sample

Is there somewhere i can find sample code for creating an Embedded Signing request using the SDK?
This of course using a file not a template. Preferably using a link to the file and not the base64 content

How to use the updateProfileImageWithHttpInfo function?

Trying to update a profile image for a User using the api, found this function but can really figure out how to use it to send the profile picture? The documentation here is also not clear: https://docs.docusign.com/esign/restapi/Users/Users/updateProfileImage/

I understand I should PUT the image, but under which name is the API expecting it?

Regarding the SDK, I can see there are two variables for the httpBody (function is declared here: https://github.com/docusign/docusign-php-client/blob/master/src/Api/UsersApi.php#L3062):

  • $formParams: which is declared inside the function as an empty array.. thus its always empty.
  • and $_tempBody, which is never declared thus isset($_tempBody) is always false.

See here for a reference of the above: https://github.com/docusign/docusign-php-client/blob/master/src/Api/UsersApi.php#L3106

Any ideas?

I have a problem to autopopulate tabs for template

I'm trying to add some values to template tabs but not act correct.
This is my code snap.

$templateRole = new DocuSign\eSign\Model\TemplateRole();
$templateRole->setClientUserId($email);
$templateRole->setEmail($email);
$templateRole->setName($recipientName);
$templateRole->setRoleName($templateRoleName);

$textTab = new \DocuSign\eSign\Model\Text();

$textTab->setTabLabel("Field Label");
$textTab->setValue('Value');

$tabs = new DocuSign\eSign\Model\Tabs();
$tabs->setTextTabs(array($textTab));
$templateRole->setTabs($tabs);

Please help me.

Just sign frame in html page

Hello, I just need the signature frame in the HTML form flow, just like Google Re Captcha get embedded in form. Is it possible anyway with Docusign / API. ?

Requirements say only PHP 5.3+ is required, but PHP 5.4 or possibly higher is actually required.

Was trying to run this on a server with PHP 5.3.5, since the requirements on this page say PHP 5.3+ is required. I kept getting an internal server error when trying to run the example code. After poking around in the internals, I noticed that one of the files was using short hand array instantiation:

$var = [];

Short hand array instantiation was not introduced to PHP until version 5.4, and that is why I was getting an internal server error while running the example code. I am not sure if there are other features used in the SDK that would push the PHP version requirement even higher, but I can say for sure that at least version 5.4 or higher is required.

Stripe Integration

We are using "createEnvelope" to send documents for different templates with stripe. In all of our template, there's different amount of stripe. Which we would like to pass from api while sending docs from api. Is there any possible way to pass stripe charge amount from api rather than define static into template. This would be very much helpful to use a single template with dynamic stripe amount to charge instead creating the different template. which is very much headache right now.

ApiException#getResponseObject is now a serialized PHP object

In v3.0.1, calling ApiException#getResponseObject() would return an ErrorDetails object:

Screen Shot 2019-07-11 at 8 02 59 AM

In the v4.0.0 release, this now returns a serialized PHP object as a string:

Screen Shot 2019-07-11 at 7 56 21 AM

The breaking changes section in the change notes do not mention this change, so I have to ask if it was intended or if this is a bug?

Class '\DocuSign\eSign\Model\DateTime' not found

Using the TemplatesApi get() method, it's failing on deserialize with the error trying to find the \DocuSign\eSign\Model\DateTime class (which does not exist, as far as I can tell).

Is there something I can do to fix this? Is this somehow dependent on my template data?

INVALID_REQUEST_BODY in EnvelopeRecipients: update

Im getting the envelopes recipients using the GET 'envelopes/{envelope_id}/recipients' endpoint.

After that i add the field 'clientUserId' and try to update the envelope, using the POST envelopes/{envelope_id}/recipients' endpoint with the very same array that i got from return from GET method as body.

But is returned the following error:

"The request body is missing or improperly formatted. Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'API_REST.Models.v2.recipientIdentityVerification' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\r\nPath 'signers[0].identityVerification', line 1, position 120."

Obs: This was working last time i tested (december/2018)

INVALID_REQUEST_BODY if I don't use `json_encode` on createEnvelope()

When trying to createEnvelope, it was throwing this error.

INVALID_REQUEST_BODY The request body is missing or improperly formatted. Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'API_REST.Models.v2.document[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.\r\n ◀ To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive t ▶ Path 'documents.documentBase64', line 1, position 31.

After debugging, I figured out on EnvelopesApi.php - L2876, I had to wrap json_encode($httpBody).

You can see my createEnvelope code here: https://stackoverflow.com/questions/52627314/docusign-cant-set-sent-on-createenvelope

Was I doing something wrong?

Docusign - Unable to get signatureimage from the envelope created by android

Hi there,
I am using this rest API to get signatureimage from the envelope
Api Documentation: https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/Envelopes/getRecipientSignatureImage/

And I am getting signature image from envelopes which are created by Web & IOS but for android's Envelope api is throwing this error

{
"errorCode": "RESOURCE_NOT_FOUND",
"message": "The URL provided does not resolve to a resource."
}

Also when I hit the API to get recipients data for envelopes, roleName is missing in Android's Envelope. I am not sure if missing rolename has relation to this issue but I am not getting signature image in case of android. Below is the API result of IOS & Android

Api Documentation: https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/EnvelopeRecipients/list/

Android

{
"signers": [],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [
{
"hostName": "Narbhit Singh",
"hostEmail": "[email protected]",
"signerName": "Vishal",
"signerEmail": "[email protected]",
"creationReason": "sender",
"requireUploadSignature": "false",
"recipientId": "1",
"recipientIdGuid": "2ff99a48-8494-4e5e-ba04-fbd940ed83e9",
"requireIdLookup": "false",
"userId": "34b3768e-615f-4ffb-887e-93b8879e73a9",
"clientUserId": "864f43be-e329-4daf-b03d-21735109af5b",
"routingOrder": "1",
"status": "completed",
"completedCount": "1",
"signedDateTime": "2020-09-24T13:02:39.3930000Z",
"deliveredDateTime": "2020-09-24T13:02:39.3930000Z",
"deliveryMethod": "offline",
"recipientType": "inpersonsigner"
}
],
"seals": [],
"witnesses": [],
"recipientCount": "1",
"currentRoutingOrder": "1"
}

IOS
{
"signers": [],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [
{
"hostName": "Narabhit Singh",
"hostEmail": "[email protected]",
"signerName": "Kiran Thakur",
"signerEmail": "",
"canSignOffline": "false",
"creationReason": "sender",
"requireUploadSignature": "false",
"recipientId": "1",
"recipientIdGuid": "6a8a8e8c-d459-41e2-ae69-05a7b3759eb7",
"requireIdLookup": "false",
"userId": "9befdcd7-cb7c-490b-983a-1a46a2ddaf1f",
"routingOrder": "1",
"note": "",
"roleName": "Signer1",
"status": "completed",
"completedCount": "1",
"signedDateTime": "2020-09-18T11:44:23.8200000Z",
"deliveredDateTime": "2020-09-18T11:43:35.9000000Z",
"deliveryMethod": "email",
"recipientType": "inpersonsigner"
}
],
"seals": [],
"witnesses": [],
"recipientCount": "1",
"currentRoutingOrder": "1"
}

can anybody help me with me this? I really searched for 3 days but couldn't get any success. Thanks in advance.

400 Error

Getting following error while creating envelope: Please guide me what I am doing wrong.

[400] Error connecting to the API (https://demo.docusign.net/restapi/v2/accounts/12345678/envelopes)

       $envelopeApi = new EnvelopesApi($apiClient);
        $sign_here = new SignHere();
        $sign_here->setXPosition(25);
        $sign_here->setYPosition(50);
        $sign_here->setDocumentId(1);
        $sign_here->setPageNumber(1);
        $sign_here->setRecipientId(1);

        $tabs = new Tabs();
        $tabs->setSignHereTabs($sign_here);

        $signers = new Signer();
        $signers->setName('Test User');
        $signers->setEmail('[email protected]');
        $signers->setRoleName('Signer');
        $signers->setRecipientId(1);
        //$signers->setClientUserId(1);
        $signers->setTabs($tabs);

        $recipients = new Recipients();
        $recipients->setSigners($signers);

        $file = file_get_contents('sample.pdf');
        $documents = new Document();
        $documents->setName('sample.pdf');
        $documents->setFileExtension('pdf');
        $documents->setDocumentId(1);
        $documents->setDocumentBase64(base64_encode($file));

        // instantiate a new envelope object and configure settings
        $envelope_definition = new EnvelopeDefinition();
        $envelope_definition->setEmailSubject('Signature Request');
        $envelope_definition->setStatus("sent");
        $envelope_definition->setDocuments($documents);
        $envelope_definition->setRecipients($recipients);

        // optional envelope parameters
        $options = new CreateEnvelopeOptions();
        $options->setCdseMode(null);
        $options->setMergeRolesOnDraft(null);
        //print_r($envelope_definition);exit;
        print_r($envelopeApi->createEnvelope($accountId, $envelope_definition, $options));`

Result

Can we have any return statements to have some thing to believe to say this worked and the request has been sent. also in the test case, i encounter the same issue.

Properly catching API exceptions

In my application there is a small chance of error when sending, so I wrap this in a try catch block and catch a standard Exception as $exception.

So when I do $exception->getResponseBody() instead of getting on object, I get a string like so:


O:8:"stdClass":2:{s:9:"errorCode";s:19:"TEMPLATE_ID_INVALID";s:7:"message";s:20:"Invalid template ID.";}

I want the message attribute but the response body is not an object.

I also tried json decoding it. Any ideas?

set custom field input for envelope

I have created custom field in docusign(Envelope Custom Fields) but not able to set it out using this package in Laravel, so can you please help me to figure it out.

$envelope_definition = new EnvelopeDefinition([ 'status' => "sent", 'composite_templates' => $compositeTemplate, 'custom_fields' => [ "text_custom_fields" => [ ["name" => "abcID", "value" => 11] ] ] ]); This is the code that may work but its not.

Class '\DocuSign\eSign\Model\OfflineAttributes' not found

When using the EnvelopesApi::listRecipients method, it fails during the deserialization process due to not being able to find \DocuSign\eSign\Model\OfflineAttributes.

Appears the class was present in v3, but has been removed in v4 of the library.

Use of reserved word List for Model

I am sure I am not the first to encounter this, but I was unable to find a solution while Googling.

I am trying to add a drop-down list to my document. At the top of my model I am adding these namespaces:

use \DocuSign\eSign\Model\List; use \DocuSign\eSign\Model\ListItem;
When doing so I get this error because "List" is a reserved word in PHP.

`A PHP Error was encountered

Severity: Parsing Error
Message: syntax error, unexpected 'List' (T_LIST), expecting identifier (T_STRING)
Filename: models/Docusign_model.php
Line Number: 19
`
I tried changing the name of the class from "List" to "Elist" but then I got errors from ObjectSerializer that it could not find Elist:swaggerType.

What am I missing on how to add a list to my document?

Thom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.