I would have expected that to work. It worked on my servers.
Try dropping the layer ID
/services.arcgis.com/somekey/arcgis/rest/services/myname/MapServer
/services.arcgis.com/somekey/arcgis/rest/services/myname/MapServer?f=json
will return the info in a code readable format.
/services.arcgis.com/somekey/arcgis/rest/services/myname//MapServer/legend or /MapServer/legend?f=json
should get you what you are after
Common esri rest params
f= Return Format [HTML | JSON | PJSON | more I can't remember ]
token= for secure services - go to "generate token" and add to your calls