Пример #1
0
 $addDocument = $signatureApi->AddSignatureEnvelopeDocument($clientId, $envelop->result->envelope->id, $guid, null, true);
 if ($addDocument->status == "Ok") {
     //Get role list for curent user
     $recipient = $signatureApi->GetRolesList($clientId);
     if ($recipient->status == "Ok") {
         //Get id of role which can sign
         for ($i = 0; $i < count($recipient->result->roles); $i++) {
             if ($recipient->result->roles[$i]->name == "Signer") {
                 $roleId = $recipient->result->roles[$i]->id;
             }
         }
         //Add recipient to envelope
         $addRecipient = $signatureApi->AddSignatureEnvelopeRecipient($clientId, $envelop->result->envelope->id, $email, $name, $lastName, $roleId, null);
         if ($addRecipient->status == "Ok") {
             //Get recipient id
             $getRecipient = $signatureApi->GetSignatureEnvelopeRecipients($clientId, $envelop->result->envelope->id);
             if ($getRecipient->status == "Ok") {
                 $recipientId = $getRecipient->result->recipients[0]->id;
                 $getDocuments = $signatureApi->GetSignatureEnvelopeDocuments($clientId, $envelop->result->envelope->id);
                 if ($getDocuments->status == "Ok") {
                     $webHook = new WebhookInfo();
                     if ($callbackUrl != "") {
                         $webHook->callbackUrl = $callbackUrl;
                     } else {
                         $webHook->callbackUrl = "";
                     }
                     $send = $signatureApi->SignatureEnvelopeSend($clientId, $envelop->result->envelope->id, $webHook);
                     if ($send->status == "Ok") {
                         $envelopeId = $envelop->result->envelope->id;
                         if ($basePath == "https://api.groupdocs.com/v2.0") {
                             $iframe = 'https://apps.groupdocs.com/signature2/signembed/' . $envelopeId . '/' . $recipientId;