Object Users¶
Name | Input Params | Return Data | Description |
---|---|---|---|
resiot_user_getlist | []String | Get a list of HexIDs of the users of your organization | |
resiot_user_info | String | String, String, String, String, String | Get user informations |
resiot_usergroup_name | String | String, String | Get the user group name |
resiot_myuserdata | String, String, String, String, String, String | Get your user informations | |
resiot_myuserdata_getcustomdata | String | String, String | Get the user custom data |
resiot_myuserdata_setcustomdata | String, String, String | String | Set the user custom data |
resiot_myuserdata_dateformat | Integer | Get your organization date format |
resiot_user_getlist()¶
Get a list of HexIDs of the users of your organization.
Example
UsersHexIDs = resiot_user_getlist()
Returns
- UsersHexIDs ([]String): The function returns a list of HexIDs of the users of your organization.
UsersHexIDs = resiot_user_getlist()
for i=1, #UsersHexIDs, 1 do
resiot_debug(UsersHexIDs[i])
end
resiot_user_info(String)¶
Get the user informations (email, first name, last name, idHex of user group) of the user who matches the idHex user in input.
Example
email, firstname, lastname, idhexgroup, err = resiot_user_info(idHexUser)
Input Parameters
- idHexUser (String): The idHex of the user you want to get the informations.
Returns
- email (String): The email of the user.
- firstname (String): The first name of the user.
- lastname (String): The last name of the user.
- idhexgroup (String): The idHex of the user group.
- err (String): The error description if the function fails.
idHexUser = "77777777"
email, firstname, lastname, idhexgroup, err = resiot_user_info(idHexUser)
if err~="" then
resiot_debug("Error: "..err)
else
resiot_debug(email)
resiot_debug(firstname)
resiot_debug(lastname)
resiot_debug(idhexgroup)
end
resiot_usergroup_name(String)¶
Get the user group name of the user group who matches the idHex user group in input.
Example
usergroupName, err = resiot_usergroup_name(idHexUsergroup)
Input Parameters
- idHexUsergroup (String): The idHex of the user group you want to get the name.
Returns
- usergroupName (String): The name of the user group.
- err (String): The error description if the function fails.
idHexUsergroup = "77777777"
usergroupName, err = resiot_usergroup_name(idHexUsergroup)
if err~="" then
resiot_debug("Error: "..err)
else
resiot_debug(usergroupName)
end
resiot_myuserdata()¶
Get your user informations (email, first name, last name, idhex user, idHex of user group).
Example
email, firstname, lastname, idhexuser, idhexgroup, err = resiot_myuserdata()
Returns
- email (String): The email of the user.
- firstname (String): The first name of the user.
- lastname (String): The last name of the user.
- idhexuser (String): The idHex of the user.
- idhexgroup (String): The idHex of the user group.
- err (String): The error description if the function fails.
email, firstname, lastname, idhexuser, idhexgroup, err = resiot_myuserdata()
if err~="" then
resiot_debug("Error: "..err)
else
resiot_debug(email)
resiot_debug(firstname)
resiot_debug(lastname)
resiot_debug(idhexuser)
resiot_debug(idhexgroup)
end
resiot_myuserdata_getcustomdata(String)¶
Get the user custom data of the user who matches the idHex user in input, the result is formatted in JSON.
Example
userCustomData, err = resiot_myuserdata_getcustomdata(idHexUser)
Input Parameters
- idHexUser (String): The idHex of the user you want to get the custom data.
Returns
- userCustomData (String): The user custom data.
- err (String): The error description if the function fails.
idHexUser = "77777777"
userCustomData, err = resiot_myuserdata_getcustomdata(idHexUser)
if err~="" then
resiot_debug("Error: "..err)
else
resiot_debug(userCustomData)
end
resiot_myuserdata_setcustomdata(String, String, String)¶
Set one of the user custom data values of the given user and key in input.
Example
err = resiot_myuserdata_setcustomdata(idHexUser, key, value)
Input Parameters
- idHexUser (String): The idHex of the user you want to set the custom data.
- key (String): The key of the custom data you want to set.
- value (String): The value you want to set in custom data for the given key.
Returns
- err (String): The error description if the function fails.
idHexUser = "77777777"
key = "usertype"
value = "guest"
err = resiot_myuserdata_setcustomdata(idHexUser, key, value)
if err~="" then
resiot_debug("Error: "..err)
else
-- value set correctly
end
resiot_myuserdata_dateformat()¶
Get the date format of your organization.
Example
dateFormatInt = resiot_myuserdata_dateformat()
Returns
- dateFormatInt (Integer): The date format in int. Value 0 means "MM/DD/YYYY", value 1 means "DD/MM/YYYY". By default it returns 0.
dateFormatInt = resiot_myuserdata_dateformat()
if dateFormatInt==0 then
-- MM/DD/YYYY
elseif dateFormatInt==1 then
-- DD/MM/YYYY
end