WPTAPI giving error in private instance

Hi,

I have a private instance setup and have valid API key. when i try in browser it is working well. but when i try as module i am getting name: ‘WPTAPIError’, code: 302, message: ‘Found’

Browser URL - Working : Getting Valid 200 response
https://demoprivateinstance.com/runtest.php?url=https://www.demoURL.com/&runs=1&location=demoLocation&f=xml&lighthouse=1&k=sampleAPIKEY

Module code not working : ‘WPTAPIError’, code: 302, message: ‘Found’

var WebPageTest = require(‘WebPageTest’);
var wpt = new WebPageTest(‘https://demoprivateinstance.com/’, ‘sampleAPIKEY’);
wpt.runTest(‘https://www.demoURL.com/’, {
connectivity: ‘Cable’,
location: ‘demoLocation’,
firstViewOnly: true,
runs: 1,
video: true
}, function processTestRequest(err, result) {
console.log(err || result)
});

Please advise

1 Like

Same issue, triggered when calling the API from a CLI script.
A few months ago, this same script worked properly.
Now I’m seeing the WPTAPIError302

$ webpagetest test -s MY-WPT-PRIV-INSTANCE -k MY-WPT-API-KEY https://example.com/url-being-tested -L MY-TEST-LABEL -l us-east-1-linux:Chrome.FIOS -r 1 -v -W -O -M -G --device iPhoneX
{
  "error": {
    "name": "WPTAPIError",
    "code": 302,
    "message": "Found"
  }
}%