{"id":17085186,"url":"https://github.com/tucker-eric/docusign-rest-client","last_synced_at":"2025-05-07T15:42:22.985Z","repository":{"id":57073498,"uuid":"59634339","full_name":"Tucker-Eric/docusign-rest-client","owner":"Tucker-Eric","description":"Wrapper for the official Docusign PHP Client Library","archived":false,"fork":false,"pushed_at":"2024-07-29T15:24:26.000Z","size":196,"stargazers_count":30,"open_issues_count":0,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T11:52:03.577Z","etag":null,"topics":["api","api-client","api-wrapper","docusign","docusign-api","docusign-php","docusign-rest","php","rest","rest-api"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tucker-Eric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-25T05:44:56.000Z","updated_at":"2024-11-08T11:26:29.000Z","dependencies_parsed_at":"2024-06-18T19:47:04.656Z","dependency_job_id":"691ae75d-7e42-4f46-840f-3d93c4fc2bfe","html_url":"https://github.com/Tucker-Eric/docusign-rest-client","commit_stats":{"total_commits":32,"total_committers":6,"mean_commits":5.333333333333333,"dds":0.40625,"last_synced_commit":"7889dd4cf72fee0390de1d12bb19029b61968ef0"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tucker-Eric%2Fdocusign-rest-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tucker-Eric%2Fdocusign-rest-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tucker-Eric%2Fdocusign-rest-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tucker-Eric%2Fdocusign-rest-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tucker-Eric","download_url":"https://codeload.github.com/Tucker-Eric/docusign-rest-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252907936,"owners_count":21823305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","api-wrapper","docusign","docusign-api","docusign-php","docusign-rest","php","rest","rest-api"],"created_at":"2024-10-14T13:23:32.657Z","updated_at":"2025-05-07T15:42:22.947Z","avatar_url":"https://github.com/Tucker-Eric.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docusign Rest Client\nWrapper for the official [Docusign PHP Client Library](https://github.com/docusign/docusign-php-client).\n\nThis library handles all the object instantiation for the endpoints in the [DocuSign Api Explorer](http://iodocs.docusign.com/).\n\n### Install Through Composer\n\n```bash\ncomposer require tucker-eric/docusign-rest-client\n```\n\n\n\n# Usage\n\nThe `DocuSign\\Rest\\Client` accesses all models and api endpoints and returns the respective obect.  It also handles all authentication as well as passing the `$account_id` to any method that requires it.\n\n### Api Endpoints\n\nAll classes in the [`DocuSign\\eSign\\Api`](https://github.com/docusign/docusign-php-client/tree/master/src/Api) namesapace are accessible as **properties** of `DocuSign\\Rest\\Client`.\n\nEach property is a the orignal class name camel cased without the `Api` suffix.\n\nExample:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\n$client = new DocuSign\\Rest\\Client([\n\t'impersonated_user_id' =\u003e $impersonated_user_id,\n\t'integrator_key'       =\u003e $integrator_key,\n\t'host'                 =\u003e $host,\n\t'private_key'          =\u003e $private_key,\n\t'auth_server'          =\u003e $auth_server\n]);\n\n$client-\u003eaccounts // Returns DocuSign\\eSign\\Api\\AccountsApi\n\n$client-\u003ecustomTabs // Returns DocuSign\\eSign\\Api\\CustomTabsApi\n\n$client-\u003efolders // Returns DocuSign\\eSign\\Api\\FoldersApi\n\n```\nThe client handles injecting the `$account_id` to any method that requires it.\n\nSo calling a method like the [`DocuSign\\eSign\\Api\\FoldersApi` `list()`](https://github.com/docusign/docusign-php-client/blob/master/src/Api/FoldersApi.php#L638) method is as easy as:\n\n```php\n$client-\u003efolders-\u003elist();  // Returns \\DocuSign\\eSign\\Model\\FoldersResponse\n```\n\n### Models\n\nAll classes in the [`DocuSign\\eSign\\Model`](https://github.com/docusign/docusign-php-client/tree/master/src/Model) namespace are accessible as a camel cased **method** of `DocuSign\\Rest\\Client` and accept an array of snake cased parameters that will be set on the model.  Calling the method returns that model object.\n\nExample:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\n$client = new DocuSign\\Rest\\Client([\n            'impersonated_user_id' =\u003e $impersonated_user_id,\n            'private_key'          =\u003e $private_key,\n            'integrator_key'       =\u003e $integrator_key,\n            'host'                 =\u003e $host,\n            'auth_server'          =\u003e $auth_server\n]);\n\n$templateRole = $client-\u003etemplateRole([\n\t'email' \t=\u003e '[SIGNER_EMAIL]',\n\t'name'  \t=\u003e '[SIGNER_NAME]',\n\t'role_name' =\u003e '[ROLE_NAME]'\n]); // Returns DocuSign\\eSign\\Model\\TemplateRole\n\n$templateRole-\u003egetRoleName() // returns '[ROLE_NAME]' as set in the above method.\n\n$envelopeDefinition = $client-\u003eenvelopeDefinition([\n\t'status'         =\u003e 'sent'\n\t'email_subject'  =\u003e '[DocuSign PHP SDK] - Signature Request Sample',\n\t'template_id'    =\u003e '[TEMPLATE_ID]',\n\t'template_roles' =\u003e [\n\t\t$templateRole\n\t],\n]); // Returns DocuSign\\eSign\\Model\\EnvelopeDefinition\n\n```\n### Api Options\n\nSome classes in the `DocuSign\\eSign\\Api` namespace have options objects that can be created and passed to methods of that class.  Those objects are accessible by calling it as a method from that Api class.  The options methods accept an array of snake cased parameters to set.  You can also call this method without any parameters and it will return the options object and you can use that object's setter methods to set its properties\n\nThe `-\u003esearch()` method in the `DocuSign\\eSign\\Api\\FoldersApi` class accepts [`DocuSign\\eSign\\Api\\FoldersApi\\SearchOptions`](https://github.com/docusign/docusign-php-client/blob/master/src/Api/FoldersApi.php#L37) to set the options.  These options are set as in the example below\n\nExample:\n\n```php\n\n$foldersApi = $this-\u003eclient-\u003efolders;\n$searchOptions = $foldersApi-\u003esearchOptions([\n\t'count'     =\u003e 20,\n\t'order_by'  =\u003e 'sent',\n\t'from_date' =\u003e '2010-01-01'\n]);\n$foldersApi-\u003esearch($searchOptions);\n\n```\nYou can retrieve any previously set options on an Api class with the `getOptions` method.  Passing the name of the method used to set the options returns that options object or not passing any parameters will return an array of all options objects for that Api class keyed by method name.\n\nExample:\n\n```php\n$envelopesApi = $this-\u003eclient-\u003eenvelopes;\n$envelopesApi-\u003ecreateEnvelopeOptions([\n\t'merge_roles_on_draft' =\u003e 'true'\n]);\n$envelopesApi-\u003eupdateOptions([\n\t'resend_envelope' =\u003e 'true'\n]);\n\n$envelopesApi-\u003egetOptions(); // returns ['updateOptions' =\u003e DocuSign\\eSign\\Api\\EnvelopesApi\\UpdateOptions, 'createEnvelopeOptions' =\u003e DocuSign\\eSign\\Api\\EnvelopesApi\\CreateEnvelopeOptions]\n\n$envelopesApi-\u003egetOptions('updateOptions') // returns DocuSign\\eSign\\Api\\EnvelopesApi\\UpdateOptions\n\n```\n\n# Examples\n\nTo login and send a signature request from a template:\n\n\u003e This will produce the same result as [this example](https://github.com/Tucker-Eric/docusign-rest-client/blob/master/docusign-template-example.md) from official Docusign Client\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nclass DocuSignSample\n{\n\tpublic function signatureRequestFromTemplate()\n\t{\n\n\t    $impersonated_user_id = \"[IMPERSONATED_USER_ID]\";\n        $private_key = \"[PRIVATE_KEY]\";\n        $integrator_key = \"[INTEGRATOR_KEY]\";\n\n\t\t// change these to production before going live\n        $host = \"https://demo.docusign.net/restapi\";\n        $auth_server = \"account-d.docusign.com\";\n\t\t// Once instantiated, authentication is handled automatically\n        $client = new DocuSign\\Rest\\Client([\n            'impersonated_user_id' =\u003e $impersonated_user_id,\n            'private_key'          =\u003e $private_key,\n            'integrator_key'       =\u003e $integrator_key,\n            'host'                 =\u003e $host,\n            'auth_server'          =\u003e $auth_server\n        ]);\n\n    \t$templateRole = $client-\u003etemplateRole([\n\t\t\t'email' \t=\u003e '[SIGNER_EMAIL]',\n\t\t\t'name'  \t=\u003e '[SIGNER_NAME]',\n\t\t\t'role_name' =\u003e '[ROLE_NAME]'\n    \t]);\n\n    \t$envelopeDefinition = $client-\u003eenvelopeDefinition([\n    \t\t'status'         =\u003e 'sent',\n    \t\t'email_subject'  =\u003e '[DocuSign PHP SDK] - Signature Request Sample',\n    \t\t'template_id'    =\u003e '[TEMPLATE_ID]',\n    \t\t'template_roles' =\u003e [\n    \t\t\t$templateRole\n    \t\t],\n    \t]);\n\t\t\n    \t$envelopeOptions = $client-\u003eenvelopes-\u003ecreateEnvelopeOptions([\t\t\t\n\t\t\t'merge_roles_on_draft' =\u003e false\n    \t]);\n\t\t\n    \t$envelopeSummary = $client-\u003eenvelopes-\u003ecreateEnvelope($envelopeDefinition, $envelopeOptions);\n\t}\n}\n```\n\nThat same example refactored in it's own class:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nclass DocuSignSample\n{\n\n\tprotected $impersonated_user_id = \"[IMPERSONATED_USER_ID]\";\n    protected $private_key = \"[PRIVATE_KEY]\";\n    protected $integrator_key = \"[INTEGRATOR_KEY]\";\n\n\t// change these to production before going live\n    protected $host = \"https://demo.docusign.net/restapi\";\n    protected $auth_server = \"account-d.docusign.com\";\n\n    protected $client;\n\n\tpublic function __construct()\n\t{\n\t\t// Once instantiated, authentication is handled automatically\n        $this-\u003eclient = new DocuSign\\Rest\\Client([\n            'impersonated_user_id' =\u003e $impersonated_user_id,\n            'private_key'          =\u003e $private_key,\n            'integrator_key'       =\u003e $integrator_key,\n            'host'                 =\u003e $host,\n            'auth_server'          =\u003e $auth_server\n        ]);\n\t}\n\t\n\t/**     \n     * @return DocuSign\\eSign\\Model\\EnvelopeSummary\n     */\n\tpublic function signatureRequestFromTemplate()\n\t{\n    \treturn $this-\u003eclient-\u003eenvelopes-\u003ecreateEnvelope($this-\u003eclient-\u003eenvelopeDefinition([\n\t    \t\t'status'         =\u003e 'sent',\n\t    \t\t'email_subject'  =\u003e '[DocuSign PHP SDK] - Signature Request Sample',\n\t    \t\t'template_id'    =\u003e '[TEMPLATE_ID]',\n\t    \t\t'template_roles' =\u003e [\n\t    \t\t\t$this-\u003eclient-\u003etemplateRole([\n\t\t\t\t\t\t'email' \t=\u003e '[SIGNER_EMAIL]',\n\t\t\t\t\t\t'name'  \t=\u003e '[SIGNER_NAME]',\n\t\t\t\t\t\t'role_name' =\u003e '[ROLE_NAME]'\n\t\t\t    \t])\n\t    \t\t]\n\t    \t])\n    \t);\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftucker-eric%2Fdocusign-rest-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftucker-eric%2Fdocusign-rest-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftucker-eric%2Fdocusign-rest-client/lists"}