@@ -24,28 +24,28 @@ Creates a new Dropbox Sign Account that is associated with the specified `email_
2424``` php
2525<?php
2626
27- require_once __DIR__ . "/vendor/autoload.php" ;
27+ namespace Dropbox\SignSandbox ;
2828
29- $config = Dropbox\Sign\Configuration::getDefaultConfiguration() ;
29+ require_once __DIR__ . '/../vendor/autoload.php' ;
3030
31- // Configure HTTP basic authorization: api_key
32- $config->setUsername("YOUR_API_KEY") ;
31+ use SplFileObject;
32+ use Dropbox ;
3333
34- // or, configure Bearer (JWT) authorization: oauth2
34+ $config = Dropbox\Sign\Configuration::getDefaultConfiguration();
35+ $config->setUsername("YOUR_API_KEY");
3536// $config->setAccessToken("YOUR_ACCESS_TOKEN");
3637
37- $accountApi = new Dropbox\Sign\Api\AccountApi($config);
38-
39- $data = new Dropbox\Sign\Model\AccountCreateRequest();
40- $data->setEmailAddress("newuser@dropboxsign.com");
38+ $account_create_request = (new Dropbox\Sign\Model\AccountCreateRequest())
39+ ->setEmailAddress("newuser@dropboxsign.com");
4140
4241try {
43- $result = $accountApi->accountCreate($data);
44- print_r($result);
42+ $response = (new Dropbox\Sign\Api\AccountApi(config: $config))->accountCreate(
43+ account_create_request: $account_create_request,
44+ );
45+
46+ print_r($response);
4547} catch (Dropbox\Sign\ApiException $e) {
46- $error = $e->getResponseObject();
47- echo "Exception when calling Dropbox Sign API: "
48- . print_r($error->getError());
48+ echo "Exception when calling AccountApi#accountCreate: {$e->getMessage()}";
4949}
5050
5151```
@@ -87,25 +87,23 @@ Returns the properties and settings of your Account.
8787``` php
8888<?php
8989
90- require_once __DIR__ . "/vendor/autoload.php" ;
90+ namespace Dropbox\SignSandbox ;
9191
92- $config = Dropbox\Sign\Configuration::getDefaultConfiguration() ;
92+ require_once __DIR__ . '/../vendor/autoload.php' ;
9393
94- // Configure HTTP basic authorization: api_key
95- $config->setUsername("YOUR_API_KEY") ;
94+ use SplFileObject;
95+ use Dropbox ;
9696
97- // or, configure Bearer (JWT) authorization: oauth2
97+ $config = Dropbox\Sign\Configuration::getDefaultConfiguration();
98+ $config->setUsername("YOUR_API_KEY");
9899// $config->setAccessToken("YOUR_ACCESS_TOKEN");
99100
100- $accountApi = new Dropbox\Sign\Api\AccountApi($config);
101-
102101try {
103- $result = $accountApi->accountGet(null, 'jack@example.com');
104- print_r($result);
102+ $response = (new Dropbox\Sign\Api\AccountApi(config: $config))->accountGet();
103+
104+ print_r($response);
105105} catch (Dropbox\Sign\ApiException $e) {
106- $error = $e->getResponseObject();
107- echo "Exception when calling Dropbox Sign API: "
108- . print_r($error->getError());
106+ echo "Exception when calling AccountApi#accountGet: {$e->getMessage()}";
109107}
110108
111109```
@@ -148,28 +146,29 @@ Updates the properties and settings of your Account. Currently only allows for u
148146``` php
149147<?php
150148
151- require_once __DIR__ . "/vendor/autoload.php" ;
149+ namespace Dropbox\SignSandbox ;
152150
153- $config = Dropbox\Sign\Configuration::getDefaultConfiguration() ;
151+ require_once __DIR__ . '/../vendor/autoload.php' ;
154152
155- // Configure HTTP basic authorization: api_key
156- $config->setUsername("YOUR_API_KEY") ;
153+ use SplFileObject;
154+ use Dropbox ;
157155
158- // or, configure Bearer (JWT) authorization: oauth2
156+ $config = Dropbox\Sign\Configuration::getDefaultConfiguration();
157+ $config->setUsername("YOUR_API_KEY");
159158// $config->setAccessToken("YOUR_ACCESS_TOKEN");
160159
161- $accountApi = new Dropbox\Sign\Api\AccountApi($config);
162-
163- $data = new Dropbox\Sign\Model\AccountUpdateRequest();
164- $data->setCallbackUrl("https://www.example.com/callback");
160+ $account_update_request = (new Dropbox\Sign\Model\AccountUpdateRequest())
161+ ->setCallbackUrl("https://www.example.com/callback")
162+ ->setLocale("en-US");
165163
166164try {
167- $result = $accountApi->accountUpdate($data);
168- print_r($result);
165+ $response = (new Dropbox\Sign\Api\AccountApi(config: $config))->accountUpdate(
166+ account_update_request: $account_update_request,
167+ );
168+
169+ print_r($response);
169170} catch (Dropbox\Sign\ApiException $e) {
170- $error = $e->getResponseObject();
171- echo "Exception when calling Dropbox Sign API: "
172- . print_r($error->getError());
171+ echo "Exception when calling AccountApi#accountUpdate: {$e->getMessage()}";
173172}
174173
175174```
@@ -211,28 +210,28 @@ Verifies whether an Dropbox Sign Account exists for the given email address.
211210``` php
212211<?php
213212
214- require_once __DIR__ . "/vendor/autoload.php" ;
213+ namespace Dropbox\SignSandbox ;
215214
216- $config = Dropbox\Sign\Configuration::getDefaultConfiguration() ;
215+ require_once __DIR__ . '/../vendor/autoload.php' ;
217216
218- // Configure HTTP basic authorization: api_key
219- $config->setUsername("YOUR_API_KEY") ;
217+ use SplFileObject;
218+ use Dropbox ;
220219
221- // or, configure Bearer (JWT) authorization: oauth2
220+ $config = Dropbox\Sign\Configuration::getDefaultConfiguration();
221+ $config->setUsername("YOUR_API_KEY");
222222// $config->setAccessToken("YOUR_ACCESS_TOKEN");
223223
224- $accountApi = new Dropbox\Sign\Api\AccountApi($config);
225-
226- $data = new Dropbox\Sign\Model\AccountVerifyRequest();
227- $data->setEmailAddress("some_user@dropboxsign.com");
224+ $account_verify_request = (new Dropbox\Sign\Model\AccountVerifyRequest())
225+ ->setEmailAddress("some_user@dropboxsign.com");
228226
229227try {
230- $result = $accountApi->accountVerify($data);
231- print_r($result);
228+ $response = (new Dropbox\Sign\Api\AccountApi(config: $config))->accountVerify(
229+ account_verify_request: $account_verify_request,
230+ );
231+
232+ print_r($response);
232233} catch (Dropbox\Sign\ApiException $e) {
233- $error = $e->getResponseObject();
234- echo "Exception when calling Dropbox Sign API: "
235- . print_r($error->getError());
234+ echo "Exception when calling AccountApi#accountVerify: {$e->getMessage()}";
236235}
237236
238237```
0 commit comments