Hi Pete,
I’m struggling since one week to get it work from web without any success, I think there is an issue with the server location because when I was in France I could use UPDATE and it was working fine but GET never work from Web page… I alse posted in another thread the same issue but without any replay…
Now I’m in Asia and both of them are not working from Web, but from my Amazon Alexa app (node js) UPDATE is working but GET still not work and I receive always “invalid Token” when I try to send the link as described in the documentation HTTP REST full API. Even after replacing the blynk server with the pinged one …
Already done I replace the serve blynk-cloud.com by the ping one 188.166.206.43, same result Blynk is working fine from my mobile, Alexa works fine as long as I use only UPDATE and not GET, from WEB non of them works … very strange because the UPDATE link works from ALEXA but not from the WEB…
What else should I do to work-out which cloud server my project lives on?
One thing strange I noticed, is that with node js in Alexa I use the method GET with the link of UPDATE. !!! . and this works from Alexa… when I send the same link from Web it doesn’t…
const myAuthPath = '/D4AU1HexWcErQ9vtpkP_EgocpnoArZKC/update/';
const valueString = '?value='
var virtualPin;
var virtualPinValue;
function sendToBlynk (_virtualPin, _virtualPinValue)
{
const blynkPath = myAuthPath.concat(_virtualPin).concat(valueString).concat(_virtualPinValue);
var options =
{
host: 'blynk-cloud.com',
path: blynkPath,
port: 80,
method: 'GET'
}
const req = http.request(options, (res) => { });
// send the request
req.write('');
req.end();
}
it returns the JSON for your project. The same call to 188.166.206.43 returns “Invalid token”, meaning that no project with your auth token exists on that server.
@bek please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
Hi Pete,
…
That works fine, means that I should always use this IP to be safe with all my APIs…?
but how could I know that my project lives on the Frankfurt server and the IP is 139.59.206.133 ?
No it isn’t.
I provided you with triple backticks, why not copy/paste them instead of using different characters and hoping that they will do the same job (which they don’t).
If you look at your device (Arduino) when it connects the serial monitor will show “redirecting to 139.59.206.133“
Otherwise you can make the auth_token/project call to the three cloud server IPs to see which one returns the JSON.
I don’t really understand your question. The API describes POST and GET methods and their different syntax. My experience is always to use GET to both read and write virtual pins.