Add/Import data to hosted Feature Layer via API

158
6
Jump to solution
01-27-2022 08:49 AM
avecchi
New Contributor II

Hello all,

I was wondering if there was a way to add GeoJSON data to an existing hosted Feature Layer (https://developers.arcgis.com/layers) programmatically via some sort of REST API or something.

I have been looking around and haven't really been able to find any information about this.

Thanks

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor II

If it's en existing hosted featurelayer, you can use applyEdits on the layer, but you need to make sure the attributes schema matches. You could do a little data transformationn, but definitely doable.

View solution in original post

0 Kudos
6 Replies
ReneRubalcava
Frequent Contributor II

If it's en existing hosted featurelayer, you can use applyEdits on the layer, but you need to make sure the attributes schema matches. You could do a little data transformationn, but definitely doable.

0 Kudos
avecchi
New Contributor II

Thanks for the info! Is it by chance possible to also create hosted Feature Layers via the API?

0 Kudos
ReneRubalcava
Frequent Contributor II

Not in the JavaScript API.

0 Kudos
avecchi
New Contributor II

Is there a way to do it via any other API like the ArcGIS REST APIs?

0 Kudos
ReneRubalcava
Frequent Contributor II

Publishing is part of the REST API, but requires an SD file from Pro to publish a layer directly. Other methods are to publish CSV or GeoJSON and create a service from that. Here's some info on using the Python API for publishing https://developers.arcgis.com/python/sample-notebooks/publishing-sd-shapefiles-and-csv/

0 Kudos
avecchi
New Contributor II

Thank you so much for all the info! I'll keep looking into this!

0 Kudos