Skip to main content
Participant
April 2, 2021
Question

Sign transient documents 415

  • April 2, 2021
  • 2 replies
  • 672 views

Can anyone give me an example request to send transient docment using API v6. I have been trying eveything I can think of and all I get is The remote server returned an error: (415) Unsupported Media Type

I'll take the request in C# or vb.net. 

This does not work

objRequest = WebRequest.Create(URI)
objRequest.Method = "POST"
objRequest.Headers.Add("Authorization", String.Format("Bearer {0}", RESTAPIKey))
objRequest.Headers.Add("Content-Disposition", String.Format("form-data;File-Name={0};File={1}", fileInfo.Name, fileInfo.FullName))
objRequest.Headers.Add("Mime-Type", "application/pdf")

Dim fs As New System.IO.FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read)
fileBytes = New Byte(fs.Length) {}
fs.Read(fileBytes, 0, fs.Length)
sw = objRequest.GetRequestStream
sw.Write(fileBytes, 0, fileBytes.Length)
'sw.Write(postbytes, 0, postbytes.Length)
sw.Close()
Dim objResponse As HttpWebResponse = CType(objRequest.GetResponse(), HttpWebResponse)
objResponse = objRequest.GetResponse()

This topic has been closed for replies.

2 replies

Participant
August 10, 2022

Did you able to solve this. If so what s solution? I am facing same issue.

Participant
May 20, 2021

hi, were you able to figure out what was wrong with this. I am sort of stuck in the same boat.