Select to view content in your preferred language

Add/Import data to hosted Feature Layer via API

984
6
Jump to solution
01-27-2022 08:49 AM
avecchi
Emerging Contributor

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
Honored Contributor

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
Honored Contributor

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
Emerging Contributor

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

0 Kudos
ReneRubalcava
Honored Contributor

Not in the JavaScript API.

0 Kudos
avecchi
Emerging Contributor

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

0 Kudos
ReneRubalcava
Honored Contributor

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
Emerging Contributor

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

0 Kudos