I am writing a python script that copies data from 1 hosted feature layer to another feature layer. This is to move data captured with survey 123 to another instance when changes to the survey have been made like extra questions.
It is all working fine except for the attachments. I can get the attachment as a string using the Attachment request detailed here: ArcGIS REST API . What I want to do with this data is write it to another feature layer that has attachments enabled using the "Add Attachment" request detailed here: ArcGIS REST API .
I am passing the string that has come from the "Attachment" request as a attachment parameter but no mater what I do I get the error:
java.lang.String cannot be cast to com.esri.arcgis.discovery.json.JSONObject
Does anybody know what I need to do to the String object to be able to pass it to the "Add Attachment" request so that it works without error? Unfortunatley the documentation is a bit light!
Any help appreciated.