Dear community,
For a school project I need to make use of the Arcgis REST API. I was reading the documentation at this page and decided to try it out with sample server 6. Unfortunately i got this response:
Ah you're right! My bad.
It looks like you need to specify query string for the "layerDefs" to get a response back. This worked for me:
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/query?layerDefs=0:1=1;1:1=1&f=json&returnidsonly=true
The format is <layerID1>:<whereClause1>;<layerID2>:<whereClause2> and so on.
Hi, Thank you for your response!
Your link definitely works, but I was actually looking to get this response as shown in the documentation. The way it was shown in the documentation is that you can make a query directly on the service to get this response and not necessarily on the layer itself.
Good morning! It appears you're trying to query the feature service instead of a specific feature layer within the service. To query a layer within the service, add the layer ID to the URL after /FeatureServer. So I think the URL you are actually looking for is this:
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0/query?where=1=1&returnidsonly=true
You can get a list of all available layers in the service by going to the endpoint below and looking under "Layers".
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.