Search code examples
docusignapi

How to resend Docusing envelope using API?


I want to resend docusing envelope using envelope id, I tried with following code and i want to send only pending signer instead of all signer.

`

           Using client As New HttpClient()
                client.BaseAddress = New Uri("https://demo.docusign.net/restapi/v2.1/")
                client.DefaultRequestHeaders.Accept.Clear()
                client.DefaultRequestHeaders.Accept.Add(New MediaTypeWithQualityHeaderValue("application/json"))
                client.DefaultRequestHeaders.Authorization = New AuthenticationHeaderValue("Bearer", "eyJ0eXAiOiJNVCIsImFs.....")

                ' Resend the envelope
                Dim response = client.PutAsync($"envelopes/a5b268be-d0be-4103-a079-09d814c/resend", Nothing).Result
                If response.IsSuccessStatusCode Then
                    Return "001:Mail resent successfully"
                Else
                    Return "002:" & "Failed to resend Mail. Error: " & response.StatusCode
                End If
            End Using          

`

But i am getting following return response

"StatusCode: 404, ReasonPhrase: 'The URL provided does not resolve to a resource.', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { X-Content-Type-Options: nosniff X-DocuSign-TraceToken: a5890c7a-f183-4050-99d5-b72376a0b806 X-DocuSign-Node: DA3DFE181 Strict-Transport-Security: max-age=31536000; includeSubDomains Cache-Control: no-cache Date: Thu, 13 Jul 2023 09:39:40 GMT Content-Length: 0 }}"


Solution

  • I believe you might be missing /accounts/account_id before /envelopes/envelope_id