Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateTabsAsync throws "INVALID_REQUEST_BODY: The request body is missing or improperly formatted. No tabs specified." #460

Open
PeterJamesLawson opened this issue Nov 20, 2024 · 1 comment

Comments

@PeterJamesLawson
Copy link

From EnvelopesApi.cs:

/// <summary>
/// Updates the tabs for a recipient.   Updates one or more tabs for a recipient in a draft envelope.
/// </summary>
/// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="accountId">The external account number (int) or account ID Guid.</param>
/// <param name="envelopeId">The envelopeId Guid of the envelope being accessed.</param>
/// <param name="recipientId">The ID of the recipient being accessed.</param>
/// <param name="tabs"> (optional)</param>
/// <returns>Task of Tabs</returns>
public async System.Threading.Tasks.Task<Tabs> UpdateTabsAsync(string accountId, string envelopeId, string recipientId, Tabs tabs = null)
{
        ApiResponse<Tabs> localVarResponse = await UpdateTabsAsyncWithHttpInfo(accountId, envelopeId, recipientId, tabs);
        return localVarResponse.Data;
}

However, either of these throw "INVALID_REQUEST_BODY: The request body is missing or improperly formatted. No tabs specified."

await EnvelopesApi.UpdateTabsAsync(accountId, envelopeId, "1");
await EnvelopesApi.UpdateTabsAsync(accountId, envelopeId, "1", null);

Any idea what I am doing wrong?

@saiharipriya
Copy link

Hello Peter, thankyou for reaching out to DocuSign. Could you please share with the complete code to reproduceit & see. The error message "INVALID_REQUEST_BODY" occurs when the payload is incorrectly formatted. In the create or update envelope request, DocuSign expects the recipient tab to be included, but it is either missing or improperly formatted in the request body.

Please take a look at the sample payload below and let me know if it helps. Alternatively, you can attach your payload so we can reproduce the issue and troubleshoot it. Thank you.

{
class Program
{
// Note: the accessToken is for testing and is temporary. It is only good for 8 hours from the time you

	private const string accountId = "";
	private const string basePath = "https://demo.docusign.net/restapi";

	// Create the envelope request and send it to DocuSign
	// Returns the resulting envelopeId or ""
	static string SendDocuSignEnvelope()
	{
		SignHere signHereTab1 = new SignHere
		{
			AnchorString = "signature",  
			AnchorXOffset = "10",  
			AnchorYOffset = "20" 
		};
		List<SignHere> signHereTabs1 = new List<SignHere> {signHereTab1};
		Text textTab1 = new Text
		{
			AnchorString = "text",  
			AnchorXOffset = "10",  
			AnchorYOffset = "30",  
			Value = "Some Text Here" 
		};
		List<Text> textTabs1 = new List<Text> {textTab1};
		Tabs tabs1 = new Tabs
		{
			SignHereTabs = signHereTabs1,  
			TextTabs = textTabs1 
		};
		Signer signer1 = new Signer
		{
			Email = "[email protected]",  
			Name = "Recipient Name",  
			RecipientId = "1",  
			Tabs = tabs1 
		};
		List<Signer> signers1 = new List<Signer> {signer1};
		Recipients recipients1 = new Recipients
		{
			Signers = signers1 
		};
		EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition
		{
			Recipients = recipients1,  
			Status = "sent" 
		};

        ApiClient apiClient = new ApiClient(basePath);
        apiClient.Configuration.AddDefaultHeader("Authorization", "Bearer " + accessToken);
        EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
        try
        {
            EnvelopeSummary results = envelopesApi.CreateEnvelope(accountId, envelopeDefinition);
            Console.WriteLine($"Envelope status: {results.Status}. Envelope ID: {results.EnvelopeId}");
            return results.EnvelopeId;
        }
       
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants