[{"attributes":{"type":"ContentVersion"},"ContentLocation":"S","ContentSize":1201,"VersionData":"/services/data/v65.0/sobjects/ContentVersion/068R500000HiP4AIAV/VersionData","VersionNumber":"1","Title":"sitertracker-logo","PublishStatus":"P","ContentBodyId":"05TR500000NUusMMAT","FileType":"PNG", "ReasonForChange":"base 64"},{"attributes":{"type":"ContentVersion"},"ContentLocation":"S","ContentSize":42521,"VersionData":"/services/data/v65.0/sobjects/ContentVersion/0683z000008xk9fAAA/VersionData","VersionNumber":"1","Title":"Sitetracker Logo - Small (Transparent)",,"ReasonForChange":" base 65 code "}]bash-4.4$
response which i need to post to endpoint url:
json payload -------- {attachement1 : sitertracker-logo.png, attachement2 : Sitetracker Logo - Small (Transparent).png} binary files ------------ sitertracker-logo.png & Sitetracker Logo - Small (Transparent).png files
currently there has reasonfor change column attribute contains Base 64 code .i will be getting multiple attachements there could 3, 4 ,5...now this i should construct one json and all the base 64 i should convert to binary and send it to endpoint url......finally one json payload with all attachments
in payload there is ReasonForChange":"base 64" here i will have base 64 code in this reason for change attribute
now i should construct one json with {attachement1: filename, attachment2: filename,attachment3 : filename}.............................adding this i should convert base 64 to binary files and attach it to restendpoint url in single transaction ,, iwant to use using Tretclient component.
the files are dynamic based on payload , we may get multiple attribute sets realted to document if there are 2 attachments, we will get 2 times the 'reason for change' column in that we will have different base 64 code.