Page 1 of 1

HTTPs API

Posted: Mon Mar 13, 2023 7:57 pm
by 0000lmht
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.

Re: HTTPs API

Posted: Sun Apr 09, 2023 6:24 am
by 0000lmht
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.

Re: HTTPs API

Posted: Thu Apr 13, 2023 6:09 pm
by ESP_Piyush
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"

Code: Select all

[
  {
    "node_id": "<your_node_id>",
    "payload": {
      "Switch": {
        "Power": true
      }
    }
  }
]
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.

Re: HTTPs API

Posted: Wed Mar 20, 2024 3:46 pm
by KaosESP32
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

Re: HTTPs API

Posted: Sun Mar 31, 2024 10:06 pm
by KaosESP32
3rd Party authentication using swagger solved at viewtopic.php?f=41&t=39024
Thanks again Manali!