Is there a way to check if dynamicLayers are supported by a map service though the API or do I have to just parse the json request manually to get the "supportsDynamicLayers": false
ArcGIDDynamicMapServiceLayer has a property called supportsDynamicLayers you can use to test this. Looks like this property has not been documented. I'll make sure it gets documented for the next release. In the meantime here's an example showing how this works.
var layer = new ArcGISDynamicMapServiceLayer("http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Energy/Geology/MapServer");
Thanks for confirming supportsDynamicLayers property on ArcGISDynamicMapServiceLayer does exist.
Retrieving data ...