Can’t get it to work yet. It turns out you have to call the API by its DNS name, not plain IP address like the current leaf code does. I’ve contacted the API provider to see if we can fix it.
Once I got this working I’ll post the new Arduino sketch to the forum.