docusign / docusign-esign-csharp-client

The Official Docusign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/
MIT License
129 stars 159 forks source link

using EnvelopesApi.CreateRecipientView #363

Closed dylandmr closed 2 years ago

dylandmr commented 2 years ago

I'm trying to call the CreateRecipientView method using the C# SDK in order to generate a link for embedded signing.

According to https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeviews/createrecipient/, I should be able to do so providing only the account ID and envelope ID to the API.

image

It matches the method's signature in the EnvelopesApi class:

public ViewUrl CreateRecipientView(string accountId, string envelopeId, RecipientViewRequest recipientViewRequest = null);

Doing exactly that, the SDK's throwing me this following exception:

Error calling CreateRecipientView: {
  "errorCode": "INVALID_REQUEST_BODY",
  "message": "The request body is missing or improperly formatted."
}

Am I supposed to fill in the optional parameter RecipientViewRequest with some additional info in order for it to work? Or is this a bug in the C# SDK?

Thanks in advance.

dylandmr commented 2 years ago

I was able to complete the call by providing the method with a RecipientViewRequest. In that object I had to fill in atleast these 5 fields:

Apparently, this method generates a recipient-specific URL, and has to be called for each recipient.

That information was not clear to me while using the SDK.

Also, the RecipientViewRequest parameter is not optional as the signature of the method suggests.

Other than that, I was able to generate a working URL for embedded signing, so I'm closing this issue.