Found the issue: apparently, starting in 10.6, print services can't accept formatted JSON anymore.
Using the AGOL print utility (https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%...) to print one of the default Esri basemaps (https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer), I've detailed the steps to reproduce.
If you input the following for the following fields:
Web Map as JSON:
{"mapOptions":{"showAttribution":false,"extent":{"xmin":-9188433.447264595,"ymin":4078001.238695625,"xmax":-8736843.484155992,"ymax":4346753.830146175,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":1155581.108577},"operationalLayers":[{"id":"World_Street_Map_417","title":"World_Street_Map_417","opacity":1,"minScale":0,"maxScale":0,"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"}],"exportOptions":{"outputSize":[946,575],"dpi":96}}
Format:
png32
Layout Template:
map_only
The print job works like a charm, however, if you format the JSON, the job will fail:
Web Map as JSON:
{
"mapOptions":{
"showAttribution":false,
"extent":{
"xmin":-9188433.447264595,
"ymin":4078001.238695625,
"xmax":-8736843.484155992,
"ymax":4346753.830146175,
"spatialReference":{
"wkid":102100,
"latestWkid":3857
}
},
"spatialReference":{
"wkid":102100,
"latestWkid":3857
},
"scale":1155581.108577
},
"operationalLayers":[
{
"id":"World_Street_Map_417",
"title":"World_Street_Map_417",
"opacity":1,
"minScale":0,
"maxScale":0,
"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
],
"exportOptions":{
"outputSize":[
946,
575
],
"dpi":96
}
}
Format:
png32
Layout Template:
map_only
Same behavior exists against sampleserver6 :
Execute Task (Export Web Map Task) <-- fails
Execute Task (Export Web Map Task) <-- works
Even using the single-tab format shown on the Esri Documentation Site fails:
Execute Task (Export Web Map Task)
Can anyone confirm that formatting JSON yields an "invalid JSON" error at 10.6 for them as well? Seems like a pretty significant problem.