I’m having the same issue. I just set up an instance in us-east-1. I tried kicking off a test via the API not giving a location and I get that API response. I checked the /getLocations.php endpoint and get
"data": {
"us-east-1:Chrome": {
"Label": "US East (N. Virginia)",
"location": "us-east-1",
"Browser": "Chrome",
"relayServer": null,
"relayLocation": null,
"labelShort": "US East (N. Virginia) - Chrome",
"default": true,
....
back. So thinking that location is default I wouldn’t think I’d need to pass in a location. I try to pass in us-east-1:Chrome for location anyway and still get that API 400 response. I check AWS console and it hadn’t spun up any test agent instances. I kick off a test from the web UI and I see it spin up an agent and my test works. Try again via API and I still get that 400 response.
From the comments in ec2_locations.ini it doesn’t sound like any locations need to be put into locations.ini as the two files get merged provided the ec2_locations=1 in settings.ini which I’ve verified it does. I’m befuddled.
Thanks themark. Still stuck on this one I’m afraid, I can’t find anything in the docs which tells you how to enable API calls to your private instance.
Think I’ve figured this out - at least I got it working for myself. Hopefully this solves your issue too! During setup of the AMI I passed in the API key which I got from the public instance at webpagetest.org. Something of the form “A.1234e5…”. This gets stored in /var/www/webpagetest/www/settings/keys.ini. I ended up removing the “A.” and just leaving everything else, ie. 1234e5… I restarted nginx and then I used 1234e5… as my API key in my calls and I was able to get a test to run.