Adding item layer to existing item using Arcgis Rest Api

404
1
08-14-2023 06:11 AM
olysyy
by
New Contributor

Hello,
I am trying to add existing feature layer to web map or web scene. Is it doable using Arcgis Rest api?
Because I was looking into /share or /copy endpoints but looks like they work for sharing items with groups only

0 Kudos
1 Reply
Raul_Jimenez
Esri Contributor

Hi @olysyy,

There is no specific endpoint to add layers to a web map or web scene, but there is a generic endpoint to update a web map or web scene specification https://[root]/content/users/[userName]/items/[itemID]/update (POST only). So you will have to previously retrieve the specification using https://[root]/content/items/[itemID]/data modify it according to the Web Map or Web Scene specifications, and save it.

If you feel comfortable with JavaScript you can also use the ArcGIS Maps SDK for JavaScript from NodeJS as @ReneRubalcava3 showed in the following video: https://www.youtube.com/watch?v=f3kfswbNf9Y

There are also specific functions to work with the REST endpoints within the ArcGIS API for Python or ArcGIS REST JS if you want.