What version of Asterisk is this, is there anything on the console? I just used http://ari.asterisk.org/ to do the same on my local running 13 and it worked fine.
Looking at the code allocation failed will occur for just that, if memory allocation fails OR if the directory couldn’t be open. By default this directory is “/var/spool/asterisk/recording”. Does that exist with the proper permissions like you mentioned?
I am using channel record ARI. http://192.168.0.123:8088/ari/channels/1497376820.1/record?name=test&format=wav&ifExists=fail&beep=true&terminateOn=any&api_key=myname:mypass
or format = ulaw.