Send multiple documents via one transaction ID
Monday, August 6, 2018 at 06:28pmIs it possible to send multiple documents via one API call and one transaction?
This is similar to the code in the example, can I just append each file to a new form for the MultipartFormDataContent?
ByteArrayContent content = new ByteArrayContent(fileByteArray);
content.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data");
content.Headers.ContentDisposition.Name = "\"file\"";
content.Headers.ContentDisposition.FileName = "\"" + MiscFunctions.RemoveSpecialCharacters(pdfDoc.Name) + ".pdf" + "\"";
content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
MultipartFormDataContent form = new MultipartFormDataContent();
form.Add(content, $"\"file\"", "\"" + MiscFunctions.RemoveSpecialCharacters(pdfDoc.Name) + ".pdf" + "\"");
form.Add(jsonContent, "\"payload\"");
Reply to: Send multiple documents via one transaction ID
Tuesday, August 7, 2018 at 04:13am"--"+boundary
. If you need to upload multiple documents, the name of the Content-Disposition shares the same as "file". And at the end, you need to use"--"+boundary+"--"
to end the request. And the second attachment is an example for creating a package with multiple documents, but it's using WebClient object to send the same REST package. Hope this could help you! Duo