I am having trouble using SharePoint's REST API to copy attachments from one list item to another list item in a different site collection. Can someone please help?
Using REST, I am able to generate the attachment, but it's contents are blank
I used a Web Request to get the contents of the attachment:
https://<site>/_api/web/getfilebyserverrelativeurl('<relativeURL>')/$value?binaryStringResponseBody=true
I then used another Web Request to add the attachment to desired list item:
https://<site>/_api/web/lists/GetByTitle('')/items({WorkflowVariable:itemID})/AttachmentFiles/add(FileName='<filename>')
However, the attachment is blank :(
I know there have been previous topics that have touched on how to do this, but I am just not able to piece together the bits to get it working.
Some of the posts and blogs I have been looking at include:
Fetching an Adding an attachment using Call Web Service action
How to execute a SP2013 REST API request with Nintex Workflow
Thanks in advance :)