Is it possible to send a picture through the REST API? Want to move a picture from one feature service to another.
I've updated some attachments, so you should be able to move them. Start by checking: Query Attachments. There are links on the side of the page for Add Attachments and Delete Attachments.
Haven't had too much luck with it. Have any examples?
It has been a while since my experimenting. I'll try to dig up my code. What you can do is explore the REST API on AGOL and examine the returned html and json. This should give you an idea of the coding needed and the process to follow.
The link to a feature should look something like:
https://<services>.arcgis.com/<account>/arcgis/rest/services/<feature>/FeatureServer/<layerID>?token=<token>
The link to query attachments (I've used "OBJECTID > 0' for the definition expression:
https://<services>.arcgis.com/<account>/arcgis/rest/services/<feature>/FeatureServer/<layerID>/queryAttachments?token=<token>
The links to update and add attachments will return a multi-part form:
https://<services>.arcgis.com/<account>/arcgis/rest/services/<feature>/FeatureServer/<layerID>/<parentID>/updateAttachment?token=<token>
https://<services>.arcgis.com/<account>/arcgis/rest/services/<feature>/FeatureServer/<layerID>/<parentID>/addAttachment?token=<token>
I'm trying to incorporate this into Integromat. A user will submit a picture via Survey123, hits integromat, runs REST to take the picture and update another feature service with the picture