Here is my code in laravel:
public function send()
{
$apiClient = new ApiClient();
$apiClient->getOAuth()->setOAuthBasePath(env('DS_AUTH_SERVER'));
try {
$accessToken = $this->getToken($apiClient);
} catch (\Throwable $th) {
return back()->withError($th->getMessage())->withInput();
}
$userInfo = $apiClient->getUserInfo($accessToken);
$accountInfo = $userInfo[0]->getAccounts();
$apiClient->getConfig()->setHost($accountInfo[0]->getBaseUri() . env('DS_ESIGN_URI_SUFFIX'));
$envelopeDefenition = $this->buildEnvelope();
try {
$envelopeApi = new EnvelopesApi($apiClient);
$result = $envelopeApi->createEnvelope($accountInfo[0]->getAccountId(), $envelopeDefenition);
$envelopeId = $result->getEnvelopeId();
$envelope = $envelopeApi->getEnvelope($accountInfo[0]->getAccountId(), $envelopeId);
// $signingUrl = $envelope->getRecipientViewUrl($envelope->getRecipients()[0]);
// dd($signingUrl);
} catch (\Throwable $th) {
return back()->withError($th->getMessage())->withInput();
}
return view('backend.response')->with('result', $result);
}
I tried a lot to get the url but can't figure out, how to achieve this? Can anyone provide some reference regarding this problem?