Skip to content

Attachments

Name Input Params Return Data Description
resiot_attachmentnew String, String String, String Creates a new attachment with the given name and content
resiot_attachmentappend String, String String Appends a text to an attachment with the given idhex and content
resiot_attachmentdelete String String Deletes the attachment with the given IdHex
resiot_attachmentempty String String Deletes the content of the attachment with the given IdHex

resiot_attachmentnew(String, String)

Creates a new attachment with the given name and content
Example
idhex, err = resiot_attachmentnew("Name", "Example text")
Input Parameters
 - File name (String): * The name of the attachment you wish to create.
 - Content (String): * The content of the attachment you wish to create.

Returns
 - IdHex (String): * Contains the IdHex of the attachment if the call was successful
 - Error (String): * Empty if the call was successful, otherwise contains the reason of the error

idhex, err = resiot_attachmentnew("Name.txt", "Example text")
if err ~= "" then
  --creation failed
else
  --creation succeeded
end

Return to index


resiot_attachmentappend(String, String)

Appends a text to an attachment with the given idhex and content
Example
err = resiot_attachmentappend("760324598234", "Example text")
Input Parameters
 - IdHex (String): * The idhex of the attachment you wish to be appended with your text.
 - TextInAppend (String): * The text you wish to append. You can use "\n" to start a new line. You can use "\t" for tabbing.

Returns
 - Error (String): * Empty if the call was successful, otherwise contains the reason of the error *

err = resiot_attachmentappend("760324598234", "Example text")
if err ~= "" then
  --append failed
else
  --append succeeded
end

Return to index


resiot_attachmentdelete(String)

Deletes the attachment with the given IdHex
Example
err = resiot_attachmentdelete("760324598234")
Input Parameters
 - IdHex (String): * The idhex of the attachment you wish to delete.
Returns
 - Error (String): * Empty if the call was successful, otherwise contains the reason of the error

err = resiot_attachmentdelete("760324598234")
if err ~= "" then
  --delete failed
else
  --delete succeeded
end

Return to index


resiot_attachmentempty(String)

Deletes the content of the attachment with the given IdHex
Example
err = resiot_attachmentempty("760324598234")
Input Parameters
 - IdHex (String): * The idhex of the attachment whose contents you wish to delete.
Returns
 - Error (String): * Empty if the call was successful, otherwise contains the reason of the error

err = resiot_attachmentempty("760324598234")
if err ~= "" then
  --empty failed
else
  --empty succeeded
end

Return to index