push data from map to arcgis Online

294
1
07-09-2023 07:35 AM
ADITYAKUMAR1
Occasional Contributor III

Hi,

  In arcgis Online we can upload Geojson after logging into ArcGIS Online. Can we do the same thing from JavaScript using any api i.e we click on a button and the data should be pushed in content of ArcGIS online?

 

Thanks

Aditya 

0 Kudos
1 Reply
mleahy_cl
New Contributor III

Are you looking to create a new item in your content?  If so, I think you'd need to post a request to the ArcGIS REST API for content managment - specifically the addItem API.  You could do this using the esriRequest function from the ArcGIS SDK for JavaScript (I'm not aware off-hand of a specific function for this in the SDK).  You could also consider the createItem method provided by ArcGIS REST JS (a separate library).