Invalid token with HTTP RESTful API (on Local Server ;P )

Does it works now? Can we run this API commands i just getting invalid token as output everytime when i execute this in browser

Yes - https://blynkapi.docs.apiary.io/

Dmitriy as u mentioned above this put method to get pin value is working when i try to update pin value is not working

http://blynk-cloud.com/2efeb4b32c1140a3a023f9024fdd62f5/update/D4?value=1

Actually I tried to connect through blynk app and it is working slowly i mean to come online it taking more time so i tried to work via local blynk server ,even it also connecting very slow can i knw the reason where will be the issue be occured because it take more time to come online in order to connect to blynk server, so i tried to work through restful api of blynk even it also not updating value of pins but get the position of pin

Dear gunner, i need small help from u actually iam trying to run restful api on my browser through http request .i can run it easily when i get connected to my mobile hotspot when i connect to blynk local server and run it showing invalid token can u please describe me where the issue will be occured. this help will be a big favour for me bcz i have been trying frm three days it not running even if i connect to hotspot i can only run status but update part cant be run for example
http://blynk-cloud.com/def7377e98a343058055c9425a7b5e1f/isAppConnected
when i run this i get invalid token when i connect to blynk server but in another mode i get true

@shama Hello, please keep your help requests in the public forum. I moved your PM back here.

I do not use the API, aside from some tests, so I do not have any quick answers for you. But I suspect you are just using some incorrect syntax, or perhaps not using https with the cloud? Or even try pinging blynk-cloud.com and using that IP instead… All just guesses. But the most obvious is that you are simply using an invalid auth :stuck_out_tongue: Try changing it in the App, carefully copy pasting it into your command and try again.

I recommend you spend lots of time searching this forum, reading all the other API posts and testing the various methods suggested before asking.

Ok Thq gunner

FYI I took your last command, used my auth and it works just fine… As stated, redo your auth and be careful with the copy paste.

image

Redo ur auth? why? i just copy pasted my authentication in browser and used blynk-cloud.com/my autnentication/isAppConnected but getting invalid token gunner:slightly_frowning_face::disappointed_relieved:

So don’t… :wink:

u mean i have to change my auth or create new project i didnt get u

You probably have a small typo or hidden (or missing) character in the existing Auth code, so I am recommending you change your Auth code (Refresh then E-mail) and try the API again with the new code…

You do not need to make a new project, but you will need to enter the new Auth into your device.

I done refresh and got new token even it showing invalid token when executing

http://blynk-cloud.com/80d3631030d247f0b4250eecc2410849/isAppConnected

You are using the Cloud Server, correct? Not a Local Server.

Well I even tried your Auth on a NodeMCU (assuming the GEO DNS bit is a non issue now… says it is OK but I never tried before)… And I get Invalid Auth… so you must be doing something strange with the code.

Shouldn’t matter, but what version App… and Android or iOS?

Listen Gunner at first i imported code in nodemcu via arduino and run through blynk app it taking more time to come online so i started using custom mode in blynk app by placing my system ip address of 192.168.1.9:9443 in blynk app .
in Command prompt i run blynk server after getting started blynk server i log in to my account in browser by typing url of 127.0.0.1:9443/admin, in which i get auth as well as registered email.
now i imported arduino code of below using static ip address

#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] =“80d3631030d247f0b4250eecc2410849”;

IPAddress ip(192,168,1,32);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid[] = “S.R.Electronics Lab”;
char pass[] = “abcdef0123456”;

void setup()
{
WiFi.config(ip,gateway,subnet);
WiFi.begin(ssid,pass);
Serial.begin(9600);

Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,9),8080);
}

void loop()
{
Blynk.run();
}

This is my nodemcu code which uploaded successfully. and came online and i executed my task.

But wheni try to execute in browser using http restful api i cant excute it by using same auth which is executed above.

Arrrgg :angry: … you have been using a Local Server Auth on a Blynk Cloud URL… Doh!!!

Use the IP of your server!!

This is what you get when you don’t read related posts :roll_eyes:… and what I get when I believe someone has an idea what they are doing :blush:

where should i use ip address of my server i mean in browser?
In this way 192.168.1.9/myauth/isappconnected?
i tried this it not working

Iam totally new to blynk and hardware core actually im Android Developer so plz dont make me feel down:disappointed_relieved::slightly_frowning_face:

If your PC (that is running the browser) is on the same network as your Server, then yes, of course the the Server IP is what you use… If you are tying to use your phone browser (on the cell network) or something connecting to the internet outside of your network, then you need to setup port forwarding and use your router’s Public IP & port