Hub - Incomplete list of layers in datasets.json

770
6
06-02-2020 04:34 PM
PhilLarkin1
Occasional Contributor III

The json generated from the sites endpoint is an incomplete list of layers offered on our site. I'm seeing 4 layers when I should see 40. This problem started around April 19th. Graham HudginsThomas Hervey

Endpoint: https://opendata.arcgis.com/api/sites/<id>/datasets.json 

Our page: Open Data Site 

Tags (2)
0 Kudos
6 Replies
ThomasHervey1
Esri Contributor

Hi,

That endpoint is most likely no longer supported. You can take a look at your site's sitemap (which is XML) https://gisdatacatalog-spokanecounty.opendata.arcgis.com/sitemap.xml and see listed datasets there. We don't have a /sites API endpoint in our current Hub API (v3), but you may be able to query datasets associated with your site in our v2 API (documentation here: https://hub.arcgis.com/api/v2/sites/%7B:id%7D?{include} ). I unfortunately wasn't able to find your site on the v2 sites endpoint, but it may be there if you do a bit of digging.

0 Kudos
PhilLarkin1
Occasional Contributor III

Thanks for your reply. I suppose I could parse the sitemap but was hoping to stick with json using an official api. 

I was using v2 to query for datasets. API Documentation (unofficial?) is here and here as revealed by Courtney Claessens‌ way back in 2017. I suppose I could hack through http://gisdatacatalog-spokanecounty.opendata.arcgis.com/data.json but it isn't pretty. 

Patrick Hammons‌ it looks like you might have an answer. How might I use v3 to get a json of my site's datasets? I see your gist at v3.md · GitHub but I' not sure how to use it to get info on my site. I don't see a siteid parameter in the docs. When I try this I get everything hosted by ESRI. Thanks for any help you can provide. 

0 Kudos
ThomasHervey1
Esri Contributor

I don't think our v3 API has a quick way to query datasets associated with a site, but I'll investigate. You can view all the datasets from an organization instead by using a filter with your orgId and a large page size like
https://hub.arcgis.com/api/v3/datasets?filter[orgId]=yourOrgId&page[size]=1000

0 Kudos
PhilLarkin1
Occasional Contributor III

Thanks for sharing that URL syntax. I gave that a shot but didn't get much. 

{
   "data": [],
   "meta": {
   "apiRoot": "http://hub.arcgis.com/api/v3/",
   "queryParameters": {
   "filter": {
   "orgId": "xxxxx",
   "isCancelled": "eventsEq(false)",
   "status": "not(private,draft,planned)",
   "endDate": "eventsBefore(1591307427179)"
}
},
   "request": "http://hub.arcgis.com/api/v3/datasets?filter[orgId]=xxxxx",
   "resourceRoot": "http://hub.arcgis.com/api/v3/datasets",
   "stats": {
   "totalCount": 0,
   "count": 0,
   "aggs": {}
},
   "page": {
   "start": 1,
   "size": 10,
   "nextStart": -1
},
"took": 5,
"total": 0,
"datasetsMatching": {
"onlySemanticFields": [],
"onlyNonSemanticFields": [],
"both": []
}
},
"links": {}
}

0 Kudos
PhilLarkin1
Occasional Contributor III

I spoke with Premium Support. Looks like I was referencing the wrong ID. Thanks again, Thomas Hervey

0 Kudos
ThomasHervey1
Esri Contributor

No problem, @PSLarkin_SpokaneCounty. We're working on improving our API documentation so the query parameters are relatively fresh in my mind. Please reach out if you run into other issues.

0 Kudos