Server error - invalid API KEY

I installed emoncms on a VPS hosted by my ISP. Everything seems to be operations as far as I can see (not much)
I am using emonTX v3 firmware running on an Arduino UNO with a strip board analog front end. I have an ESP8266 running emonESP. I can connect to any MQTT server but I am having problems connecting to the emoncms server. I added the device and copied the API KEY to the emonESP. I keep getting this error

|ERROR|index.php|Invalid API key |
Any advice please.