JSON Varies Amongst Web Mapping Application Types

408
0
09-28-2017 10:46 AM
SethLewis1
Occasional Contributor III

Per the ArcGIS REST API Item Types page, there is a Web Mapping Application type. See here: ArcGIS REST API 

Using that item type, when I call

gis.content.search('', 'web mapping application')‍‍

on a portal I can receive back JSON for items built using different templates (e.g. WebApp Builder and Storymaps).

However, the JSON appears to vary between the item types (see bellow).

Is there a method in the API that would allow us to more easily parse the varying data structures when we call

gis.content.search('', 'web mapping application')‍‍

I'm attempting to harvest both a list of all web mapping applications in a given portal and slice through their JSON to retrieve the underlying webmap ID in order to visualize 1:M relationships.

Sample Storymap Data:

{
  "source": "sourceID",
  "folderId": null,
  "values": {
    "title": "Title",
    "subtitle": "Title",
    "order": [
      {
        "id": 28,
        "visible": false
      }
    ],
    "webmap": "authoring webmap ID",
    "layout": "integrated",
    "placardPosition": "",
    "locationButton": true,
    "colors": "#152638;#728294;#ebebeb",
    "headerLinkText": "",
    "headerLinkURL": "",
    "logoURL": "",
    "logoTarget": "URL",
    "social": {
      "facebook": false,
      "twitter": false,
      "bitly": false
    },
    "zoomLevel": "18",
    "sourceLayer": "maptour-layer1475173714814_0",
    "template": "Map Tour",
    "templateCreation": "2.5.2",
    "templateVersion": "2.8.0",
    "firstRecordAsIntro": true
  }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Sample WebApp Builder Data

{
theme: {
name: "FoldableTheme",
styles: [],
version: "2.0"
},
portalUrl: "http://tempegov.maps.arcgis.com",
appId: "",
authorizedCrossOriginDomains: [],
title: "Zoning and Overlay Districts",
subtitle: "<div class="attribute-custom-style"></div>",
keepAppState: true,
links: [],
widgetOnScreen: {},
map: {
3D: false,
2D: true,
position: {},
itemId: "84d75bd05f1d47f8a0266f8778c4498f",
mapOptions: {},
id: "map",
portalUrl: "http://tempegov.maps.arcgis.com"
},
widgetPool: {},
mobileLayout: {},
loadingPage: {
backgroundColor: "#508dca",
backgroundImage: {
visible: false
},
loadingGif: {
visible: true,
uri: "configs/loading/images/predefined_loading_1.gif",
width: 58,
height: 29
}
},
wabVersion: "2.4",
_buildInfo: {},
isWebTier: false,
httpProxy: {}
}
0 Kudos
0 Replies