1
1
GET /rest/db/file
2
2
=================
3
3
4
- Returns most data available about a given file, including version and
5
- availability. Takes ``folder `` and ``file `` parameters. ``local `` and
6
- ``global `` refer to the current file on disk and the globally newest file,
7
- respectively.
4
+ Returns most data about a given file, including version and availability.
8
5
9
- .. code-block ::
6
+ Request
7
+ -------
8
+
9
+ The call requires parameters for ``folder `` and ``file `` in the query string:
10
+
11
+ - ``folder `` is the folder ID which you can find in the Syncthing Web GUI,
12
+ e.g. ``5camp-slpa8 ``.
13
+
14
+ - ``file `` is the relative path of the file starting from the folder root to the
15
+ file you are interested in. The path and filename must be correctly
16
+ URL-encoded.
17
+
18
+ Example Request
19
+ ^^^^^^^^^^^^^^^
20
+
21
+ .. code-block :: bash
22
+
23
+ $ curl -s -H X-API-KEY:... " http://localhost:8384/rest/db/file?folder=YOUR_FOLDER_ID" --url-query " file=path/to/file.pdf"
24
+
25
+ Response
26
+ --------
27
+
28
+ .. code-block :: json
10
29
11
30
{
12
31
"availability" : [
@@ -16,46 +35,48 @@ respectively.
16
35
}
17
36
],
18
37
"global" : { /* a file entry */ },
19
- "local": { /* a file entry */ }
20
- }
21
-
22
- A file entry looks like this::
23
-
24
- {
25
- {
26
- "deleted": false,
27
- "ignored": false,
28
- "inodeChange": "1970-01-01T01:00:00+01:00",
29
- "invalid": false,
30
- "localFlags": 0,
31
- "modified": "2022-09-28T08:07:19.979723+02:00",
32
- "modifiedBy": "523ITIE",
33
- "mustRescan": false,
34
- "name": "img",
35
- "noPermissions": false,
36
- "numBlocks": 0,
37
- "permissions": "0755",
38
- "platform": { /* platform specific data */ },
39
- "sequence": 914,
40
- "size": 128,
41
- "type": "FILE_INFO_TYPE_DIRECTORY",
42
- "version": [
43
- "523ITIE:1664345275"
44
- ]
45
- },
38
+ "local" : { /* a file entry */ },
46
39
"mtime" : {
47
40
"err" : null ,
48
41
"value" : {
49
42
"real" : " 0001-01-01T00:00:00Z" ,
50
43
"virtual" : " 0001-01-01T00:00:00Z"
51
- }
52
44
}
53
45
}
54
46
47
+ ``local`` and ``global`` refer to the current file on the local device and the
48
+ globally newest file, respectively. A file entry looks like this:
49
+
50
+ .. code-block:: json
51
+
52
+ {
53
+ "deleted" : false ,
54
+ "ignored" : false ,
55
+ "inodeChange" : " 1970-01-01T01:00:00+01:00" ,
56
+ "invalid" : false ,
57
+ "localFlags" : 0 ,
58
+ "modified" : " 2022-09-28T08:07:19.979723+02:00" ,
59
+ "modifiedBy" : " 523ITIE" ,
60
+ "mustRescan" : false ,
61
+ "name" : " img" ,
62
+ "noPermissions" : false ,
63
+ "numBlocks" : 0 ,
64
+ "permissions" : " 0755" ,
65
+ "platform" : { /* platform specific data */ },
66
+ "sequence" : 914 ,
67
+ "size" : 128 ,
68
+ "type" : " FILE_INFO_TYPE_DIRECTORY" ,
69
+ "version" : [
70
+ " 523ITIE:1664345275"
71
+ ]
72
+ }
73
+
55
74
Platform specific data may be ownership, extended attributes, etc. and is
56
- divided into entries per operating system / platform. An example platform
57
- entry containing ownership information for Unix systems and an extended
58
- attribute for macOS ("darwin") looks as follows::
75
+ divided into entries per operating system / platform. An example platform entry
76
+ containing ownership information for Unix systems and an extended attribute for
77
+ macOS ("darwin") looks as follows:
78
+
79
+ .. code-block:: json
59
80
60
81
{
61
82
"darwin" : {
0 commit comments