$iframe = 'https://stage-apps-groupdocs.dynabic.com/document-viewer/Embed/' . $fileGuId; //Iframe to realtime server } elseif ($basePath == "http://realtime-api.groupdocs.com") { $iframe = 'http://realtime-apps.groupdocs.com/document-viewer/embed/' . $fileGuId; } } if ($iframeType == "annotation") { if ($basePath == "https://api.groupdocs.com/v2.0") { $iframe = 'http://apps.groupdocs.com/document-annotation2/embed/' . $fileGuId; //iframe to dev server } elseif ($basePath == "https://dev-api.groupdocs.com/v2.0") { $iframe = 'http://dev-apps.groupdocs.com/document-annotation2/embed/' . $fileGuId; //iframe to test server } elseif ($basePath == "https://stage-api-groupdocs.dynabic.com/v2.0") { $iframe = 'https://stage-apps-groupdocs.dynabic.com/document-annotation2/Embed/' . $fileGuId; //Iframe to realtime server } elseif ($basePath == "http://realtime-api.groupdocs.com") { $iframe = 'http://realtime-apps.groupdocs.com/document-annotation2/embed/' . $fileGuId; } } $iframe = $signer->signUrl($iframe); //If request was successfull - set url variable for template F3::set('fileId', $fileGuId); F3::set('url', $iframe); } //Process template F3::set('userId', $clientId); F3::set('privateKey', $privateKey); F3::set('width', $width); F3::set('height', $height); echo Template::serve('sample09.htm');
$signFieldEnvelopSettings->forceNewField = true; $signFieldEnvelopSettings->page = "1"; //Add second signature field to document $addEnvelopSecondField = $signature->AddSignatureEnvelopeField($clientId, $envelop->result->envelope->id, $getDocuments->result->documents[0]->documentId, $addSecondRecipient->result->recipient->id, "0545e589fb3e27c9bb7a1f59d0e3fcb9", $signFieldEnvelopSettings); if ($addEnvelopSecondField->status == "Ok") { try { //Create WebHook object (URL which will be trigered by callback) $webHook = new WebhookInfo(); $webHook->callbackUrl = ""; //Send envelop for signing $send = $signature->SignatureEnvelopeSend($clientId, $envelop->result->envelope->id, $webHook); if ($send->status == "Ok") { //Create URL for iframe $iframe = "https://apps.groupdocs.com/signature2/signembed/" . $envelop->result->envelope->id . '/' . $addRecipient->result->recipient->id; //Sign URL $iframe = $signer->signUrl($iframe); F3::set('url1', $iframe); //Create URL for second iframe $iframe2 = "https://apps.groupdocs.com/signature2/signembed/" . $envelop->result->envelope->id . '/' . $addSecondRecipient->result->recipient->id; //Sign URL $iframe2 = $signer->signUrl($iframe2); F3::set('url2', $iframe2); } else { throw new Exception($send->error_message); } } catch (Exception $e) { $error = 'ERROR: ' . $e->getMessage() . "\n"; F3::set('error', $error); } } else { throw new Exception($addEnvelopSecondFields->error_message);
//Get file guid if ($getDocumentStatus->status == "Ok") { $guid = $getDocumentStatus->result->documents[0]->documentId; if ($basePath == "https://api.groupdocs.com/v2.0") { $iframe = 'http://apps.groupdocs.com/document-viewer/embed/' . $guid; //iframe to dev server } elseif ($basePath == "https://dev-api.groupdocs.com/v2.0") { $iframe = 'http://dev-apps.groupdocs.com/document-viewer/embed/' . $guid; //iframe to test server } elseif ($basePath == "https://stage-api-groupdocs.dynabic.com/v2.0") { $iframe = 'https://stage-apps-groupdocs.dynabic.com/document-viewer/Embed/' . $guid; //Iframe to realtime server } elseif ($basePath == "http://realtime-api.groupdocs.com") { $iframe = 'http://realtime-apps.groupdocs.com/document-viewer/embed/' . $guid; } $iframe = $signature->signUrl($iframe); F3::set('iframe', $iframe); } else { throw new Exception($getDocumentStatus->error_message); } } catch (Exception $e) { $error = 'ERROR: ' . $e->getMessage() . "\n"; F3::set('error', $error); } } else { throw new Exception($response->error_message); } } catch (Exception $e) { $error = 'ERROR: ' . $e->getMessage() . "\n"; F3::set('error', $error); }
} else { //Throw error message throw new Exception($newUser->error_message); } } //Get all collaborators for current document $getCollaborators = $antApi->GetAnnotationCollaborators($clientId, $fileId); if ($getCollaborators->status == "Ok") { //Loop for checking all collaborators for ($n = 0; $n < count($getCollaborators->result->collaborators); $n++) { //Check is user with entered email already in collaborators if ($getCollaborators->result->collaborators[$n]->guid == $userGuid) { //Add user GUID as "uid" parameter to the iframe URL $url = $url . "?uid=" . $userGuid; //Sign iframe URL $url = $signer->signUrl($url); break; } } //Check whether user was founded in collaborators list if (strpos($url, "?uid=")) { //If was set variable with URL for iframe F3::set("url", $url); //If user wasn't founded in collaborators list - add him to it } else { //Create array with entered email for SetAnnotationCollaborators method $arrayEmail = array($email); //Add user as collaborators for the document $setCollaborator = $antApi->SetAnnotationCollaborators($clientId, $fileId, "v2.0", $arrayEmail); if ($setCollaborator->status == "Ok") { // Check the result of the request