Search code examples
laravel-8docusignapidocusign-sdk

I want to get recipient_signing_uri from the Docusign API response but it returns null


Here is the code

public function send(Request $request): object
    {
       
        $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($request);
        try {
            $envelopeApi = new EnvelopesApi($apiClient);
            $result = $envelopeApi->createEnvelope($accountInfo[0]->getAccountId(), $envelopeDefenition);
            dd($result);
        } catch (\Throwable $th) {
            return back()->withError($th->getMessage())->withInput();
        }
        return view('backend.response')->with('result', $result);
    }

When I print $result variable it returns a response like this

container: array:8 [
    "bulk_envelope_status" => null
    "envelope_id" => "b634f8c5-96c5-4a18-947f-59418d8c4e03"
    "error_details" => null
    "recipient_signing_uri" => null
    "recipient_signing_uri_error" => null
    "status" => "sent"
    "status_date_time" => "2023-02-16T07:24:39.1570000Z"
    "uri" => "/envelopes/b634f8`your text`c5-96c5-4a18-947f-59418d8c4e03"
  ]

I want to get the value of recipient signing uri in response but in my case it returns null

How I can achieve this? Will anyone suggests?


Solution

  • Since you are not using embedded signing, you can not get the signing URL. Users will receive automated emails which they will use to sign the documents.