file.list
The file.list command is used to find and return a list of files.
TR50 Request
{
"cmd": {
"command": "file.list",
"params": {
"global": true,
"tags": ["tag1", "tag2"]
}
}
}
Request Parameters
Name
Description
thingKey
The Thing associated with the files. Defaults to the current session's Thing.
global
If set to true, the files are global files and the thingKey parameter will be ignored.
If this request is made by a thing, the thingKey of the thing will be used. If this command is not issued by a thing, either thingKey or global must be specified.
tags
offset
limit
TR50 Reponse
If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true,
"params": {
"result": [
{
"id": "536adfdb3100461c910041a4",
"uploadDate": "2014-05-08T01:37:31.158Z",
"fileName": "MyTestFile.txt",
"length": 3030,
"public": true,
"tags": [
"txt"
]
},
{
"id": "536ae07d3100461c9100420a",
"uploadDate": "2014-05-08T01:40:13.294Z",
"fileName": "MySecureTestFile.txt",
"length": 3030,
"tags": [
"txt"
]
}
]
}
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
count |
Integer |
The total number of matching results. |
result |
Array |
An array consisting of result objects. |
Result Object
Name |
Type |
Description |
---|---|---|
id |
String |
The unique identifier of the file. |
uploadDate |
String |
The timestamp associated with the creation of this file. |
fileName |
String |
The name of the file. |
public |
Boolean |
Whether the file is publicly accessible. |
length |
Integer |
The size of the file in bytes. |
tags |
Array |
The tags associated with the file. |