//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; //iframe to dev server } elseif ($basePath == "https://dev-api.groupdocs.com/v2.0") { $iframe = 'https://dev-apps.groupdocs.com/signature2/signembed/' . $envelopeId . '/' . $recipientId; //iframe to test server } elseif ($basePath == "https://stage-api-groupdocs.dynabic.com/v2.0") { $iframe = 'https://stage-apps-groupdocs.dynabic.com/signature2/signembed/' . $envelopeId . '/' . $recipientId; } elseif ($basePath == "http://realtime-api.groupdocs.com") { $iframe = 'https://relatime-apps.groupdocs.com/signature2/signembed/' . $envelopeId . '/' . $recipientId; } $iframe = $signer->signUrl($iframe); //Set variable with results for template