Adding Attachment in .Net

30 views
Skip to first unread message

lope...@yahoo.com

unread,
Oct 6, 2020, 12:36:33 PM10/6/20
to Developer Group - VA Lighthouse APIs
Hey guys.  I'm attempting to attach a PDF to the JSON payload and supply it to the Benefits Intake API.  I am able to complete a POST to the sandbox and receive a GUID and folder to place the file but when I attempt the PUT I receive a DOC103 error, "Invalid PDF content, part content".  I'm currently reading the file into a Byte array and adding that to the JSON code.  I'm using VB.Net and WebRequest object to do the POST.  Any suggestions?  Thanks.

Ryan Link (VA Lighthouse)

unread,
Oct 6, 2020, 12:41:00 PM10/6/20
to Developer Group - VA Lighthouse APIs

lope...@yahoo.com

unread,
Oct 6, 2020, 12:56:18 PM10/6/20
to Developer Group - VA Lighthouse APIs
Not exactly.  I’m able to get the file.  I don’t know how to add it to the JSON payload.

Ryan Link (VA Lighthouse)

unread,
Oct 6, 2020, 4:30:10 PM10/6/20
to Developer Group - VA Lighthouse APIs
Hi Dan, understood.  How about this?  I'm not aware of any other developers using VB.NET for this but anyone subscribed to this group should see the topic. https://forums.asp.net/t/2126757.aspx?How+to+Post+pdf+file+inside+json
Reply all
Reply to author
Forward
0 new messages