@@ -23,13 +23,15 @@ public static function getConnectedFieldsTabGroups(string $accountId, string $ac
2323 $ client = new Client ();
2424
2525 try {
26+ #ds-snippet-start:ConnectedFields1Step3
2627 $ response = $ client ->request ('GET ' , $ url , [
2728 'headers ' => [
2829 'Authorization ' => "Bearer $ accessToken " ,
2930 'Accept ' => 'application/json ' ,
3031 'Content-Type ' => 'application/json '
3132 ]
3233 ]);
34+ #ds-snippet-end:ConnectedFields1Step3
3335
3436 $ body = $ response ->getBody ()->getContents ();
3537 $ data = json_decode ($ body , true );
@@ -41,6 +43,7 @@ public static function getConnectedFieldsTabGroups(string $accountId, string $ac
4143 }
4244 }
4345
46+ #ds-snippet-start:ConnectedFields1Step4
4447 public static function filterData (array $ data ): string
4548 {
4649 $ filteredData = array_filter ($ data , function ($ item ) {
@@ -61,6 +64,7 @@ public static function filterData(array $data): string
6164
6265 return json_encode (array_values ($ filteredData ));
6366 }
67+ #ds-snippet-end:ConnectedFields1Step4
6468
6569 public static function sendEnvelope (
6670 $ basePath ,
@@ -72,10 +76,13 @@ public static function sendEnvelope(
7276 $ signerName ,
7377 $ signerEmail
7478 ): string {
79+ #ds-snippet-start:ConnectedFields1Step2
7580 $ config = new Configuration ();
7681 $ config ->setHost ($ basePath );
7782 $ config ->addDefaultHeader ('Authorization ' , 'Bearer ' . $ accessToken );
83+ #ds-snippet-end:ConnectedFields1Step2
7884
85+ #ds-snippet-start:ConnectedFields1Step6
7986 $ apiClient = new ApiClient ($ config );
8087 $ envelopesApi = new EnvelopesApi ($ apiClient );
8188
@@ -91,8 +98,10 @@ public static function sendEnvelope(
9198 $ results = $ envelopesApi ->createEnvelope ($ accountId , $ envelope , $ options );
9299
93100 return $ results ->getEnvelopeId ();
101+ #ds-snippet-end:ConnectedFields1Step6
94102 }
95103
104+ #ds-snippet-start:ConnectedFields1Step5
96105 public static function makeEnvelopes ($ app , $ signerName , $ signerEmail , $ pdfDoc , $ demoPath ): EnvelopeDefinition
97106 {
98107 $ appId = $ app ['appId ' ] ?? null ;
@@ -194,4 +203,5 @@ public static function makeEnvelopes($app, $signerName, $signerEmail, $pdfDoc, $
194203
195204 return $ envelope ;
196205 }
206+ #ds-snippet-end:ConnectedFields1Step5
197207}
0 commit comments