Add Variable Endpoint POST
Adds variables to your account by specifying its name, value and optionally the type and unit.
Basic Authentication Endpoint
POST
/var/add
content_copy
Authorization Header
This endpoint uses Basic Authentication for username and password.
Parameter
Description
username
The registered username of the account.
password
The registered password of the account.
Bearer Token Authentication Endpoint
POST
/var/add-viatoken
content_copy
Authorization Header
This endpoint uses Bearer Authentication for the variable adding.
Parameter
Description
Bearer
A user's generated token
Request Body Parameters
Parameter
Description
variable_name
The name the user want to call their variable
value *
The initial value of the variable
variable_type *
The variable type if numeric (default), boolean or text
unit *
The unit of the variable (i.e. Celcius, Pa, °F)
* optional
Response
Successful Variable Adding
- Status Code: 200 Ok
- Response Body:
json
{
"message"
:
"Variable is added"
,
"variable"
:
"Temperature"
,
}