Hi everyone,
when i use Blynk 2.0 to control relay, i can use web brower to control switch, by https api.
link : https://docs.blynk.io/en/blynk.cloud/update-property
So, with ESP RainMaker, can i do that?
Thanks.
HTTPs API
Re: HTTPs API
I found the API category, however, I don't know how to use it to control the switch via url.
Can someone help me with an example of this.
Can someone help me with an example of this.
-
- Posts: 309
- Joined: Wed Feb 20, 2019 7:02 am
Re: HTTPs API
Here is how I typically use the APIs directly from the RainMaker Swagger File.
1. Search for the POST login2 API.
2. Click on "Try it out" and enter your RainMaker user_name and password and "Execute"
3. Copy the accesstoken value from the response. Go to top of Swagger file, click on "Authorize" and enter the access token value. Now, you are logged in.
4. Identify the node_id for the node to which you want to send the data.
5. Search for the PUT /user/nodes/params API.
6. Click on "Try it out", enter the following payload and "Execute"
7. The above will turn on the switch (given that the node_id is valid and indeed belongs to you). Passing "Power": false will turn it off.
Similar can be done via Postman or any other client too. I hope this helps.
1. Search for the POST login2 API.
2. Click on "Try it out" and enter your RainMaker user_name and password and "Execute"
3. Copy the accesstoken value from the response. Go to top of Swagger file, click on "Authorize" and enter the access token value. Now, you are logged in.
4. Identify the node_id for the node to which you want to send the data.
5. Search for the PUT /user/nodes/params API.
6. Click on "Try it out", enter the following payload and "Execute"
Code: Select all
[
{
"node_id": "<your_node_id>",
"payload": {
"Switch": {
"Power": true
}
}
}
]
Similar can be done via Postman or any other client too. I hope this helps.
Re: HTTPs API
Hi all,
has anyone succeed on using the online version of swagger api login2 using a google account (3rd party auth) instead of user+password?
Alternatively, How to get the access token mentioned in the 3rd step using a google account as identity provider?
Thanks in advance
has anyone succeed on using the online version of swagger api login2 using a google account (3rd party auth) instead of user+password?
Alternatively, How to get the access token mentioned in the 3rd step using a google account as identity provider?
Thanks in advance
Re: HTTPs API
3rd Party authentication using swagger solved at viewtopic.php?f=41&t=39024
Thanks again Manali!
Thanks again Manali!
Who is online
Users browsing this forum: No registered users and 41 guests