I've created a successful call to an authenticated service via makeWebRequest on the simulator. All's good, right? Nah. On the watch it's returning with a 400 return code.
When I move the app over to my Fenix 5, the web request fails. I added the openWebPage to see what the url was returning and the url that was sent does not include the params or options (and the response from the server is the same response you get if you hit the url with no parameters.)
What am I missing?
Here's my code:var url = "api.aerisapi.com/.../" + Math.toDegrees(latlon[0]) + "," + Math.toDegrees(latlon[1]); // set the url
var params = { // set the parameters
"client_id" => "<my_id>",
"client_secret" => "<my_secret>",
"filter" => "1hr",
"limit" => "12",
"fields" => ["periods.timestamp","periods.pop"],
"from" => "now"
};
var options = { // set the options
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_URL_ENCODED
};
var responseCallback = method(:onReceive);
Communications.openWebPage(
url,
params,
options
);
Communications.makeWebRequest(
url,
params,
options,
responseCallback
);
And here's the url openWebPage asks for:https://api.aerisapi.com/forecasts/34.088840,-84.193510
And here's the response I get:{"success":false,"error":{"code":"invalid_client","description":"A valid \"client_id\" and \"client_secret\" were not provided."},"response":[]}
Any ideas?