Hi,
I just discovered blynk, great project!
Is it possible to create a new project within the app, copy the generated auth-token into
the HTTP REST example and read/write the virtual wires?
I have read the HTTP RESTful API docs and tried to read the v1 pin. But using the auth token from the App results in an “Invalid token.” - error!
I want to use it to control a piece of software on my PC without “real” connected hardware.
1 Like
Hello. Yes. You can. Do you use Blynk Cloud? Please show me URL you are using.
Yes I do, but everything the API returns is “Invalid token.”
@eltomato You most probably using URL of blynk-qa (URL in API description), that is not Blynk Cloud.
Thats a BINGO!
Thank you very much!
I couldn’t find it in the docs. Maybe this endpoint should be added to the Apiary docs
It is still under testing. We will publish it when ready.
Costas
8
@Dmitriy can we only read the virtual pins at present with HTTP REST i.e. write is not enabled?
@Costas write is enabled. Method type : PUT. See API description.
1 Like
Costas
10
I tried it with php as:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://cloud.blynk.cc:8080/c19a7a406e194684a2648ebxxxxx/pin/V7");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, "[
\"1\"
]");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
Server error, the read for php is fine.
Dmitriy
13
I think here is something wrong with escaping of value.
What is blynk-qa?
Can you explain more?
Gunner
15
@sh.abar.mard This topic is almost two years old… whatever was being referred too, assuming it wasn’t a typo, is unlikely to be relevant anymore
Refer to here for current Blynk HTTP RESTful API info and create another new topic if required.