Hello, I was wondering if anyone could help me with a script for API basic authentication (REST API).
I have only recieved a username, password and a specific URL for the request, which returns a table in JSON format.
I have tested the request in Postman and it works fine, I have looked at the Tesla API script and other examples but I am having trouble understanding how to do the request properly in LUA.
This is the response from the request in Postman:
I have to access "Number" (Room number) and "Status" (HVAC State) in the response and send it to an internal storage variable or something to compare it to the previous recieved value.
I have only recieved a username, password and a specific URL for the request, which returns a table in JSON format.
I have tested the request in Postman and it works fine, I have looked at the Tesla API script and other examples but I am having trouble understanding how to do the request properly in LUA.
This is the response from the request in Postman:
Code:
[
{
"number": "205",
"statuses": [
{
"status": "2",
"changeDate": "2019-08-05"
}
]
},
{
"number": "515",
"statuses": [
{
"status": "2",
"changeDate": "2019-08-05"
}
]
}
]
I have to access "Number" (Room number) and "Status" (HVAC State) in the response and send it to an internal storage variable or something to compare it to the previous recieved value.