I need to add a feature layer to ArcGIS Online account from code.

i have created a developer account where if i want to create a feature layer i have to upload a CSV file and it makes the feature layer.

Problem is: i need to create the sane feature layer using my code. like is there any REST API or some API which ArcGIS provide this option?

2 Answers 2


I've checked requests which were sent in ArcGIS Online to add Feature Service with Chrome dev tools and found that it uses 4 requests:

  1. Create Service - create feature service with REST API without layers, see http://resources.arcgis.com/en/help/arcgis-rest-api/#/Create_Service/02r30000027r000000/
  2. update Service item - fix service name, see http://resources.arcgis.com/en/help/arcgis-rest-api/#/Update_Item/02r30000009s000000/
  3. addToDefinition request for admin part, see http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Add_To_Definition_Feature_Service/02r300000230000000/ - this is the request to add layer definition into empty service
  4. Last request to updateDefinition of the service (http://resources.arcgis.com/en/help/arcgis-rest-api/#/Update_Definition_Feature_Service/02r30000021z000000/).

There is definitely a REST API for working with ArcGIS Online and Portal.

This is the specific operation for publishing a hosted feature service from .csv


  • Jhon thanks for reply.. but i'm looking for creating a feture layer from the code.. Commented Apr 4, 2014 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.