Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The message body contains a JSON object:

scope

The scope object. Note that if you use a document set or global search scope, you will receive an "available" = false result. In fact these scopes do not support files.

didThe document id. This must be a document within the scope.
localesNull or optional list of locales you want to get information for. If null then you get info for all the authorized locales in scope.
populateDepth

Null or optional depth of file structure to load:

  • Not specified (recommended): Depth is 100.
  • 0: Do not actually load any sub folders and thus includes just the basic information on the deliverable and the attachment root folder.

 

...

available

Boolean. If false, then no other property is populated. It means that the scope does not propose any file management or the user cannot do any file management.

Ideally, completely hide away files tools or show a message.

This property is also included in the segments rights properties as property "hasFiles". So you should check this first!

bool
didThe document id.int
dsidThe document set id.int
nameThe name of the original file (including folders).string
localesA dictionary where the key is a locale and the value is an object with files details in this language, see below.

 

Each item in locales has these properties:

locale

The locale.

isSourceTrue: This is the source language.
 Source file or deliverable related properties
deliverableRequiredBoolean. True if the user must submit a deliverable. If true, the user can only approve if a physical file was set (see exists property on deliverable).
deliverableApprovedBoolean. True if the user confirmed that deliverable is done as expected. Includes case where user says no, I do not want to set a deliverable.
canDocSetBoolean. Tells if the deliverable can be set, renamed or deleted.
canDocDownload

Boolean. Right to download the file.

canDocPreviewBoolean: Right to web preview the file.
documentA file node describing the document.
 Attachments
canAttSetBoolean. User can set, rename, delete, manipulate attachments.
attachmentsA folder node that contains the attachments.

 

The file/folder nodes form a tree structure. A folder node may have file node and folder node children.

isdir

True: This is a folder node

False: This is a file node

nameName of file or folder
folderInternal identifier of the parent node. Folder IDs are required when manipulating files.
existsBoolean. Tells if the file or folder actually exists. If this node is a deliverable, it will be prepopulated with all information (such as the expected name of deliverable) but the deliverable may not yet exist on the server.
readonly

Boolean. Tells if the file is readonly or not. The original file will be readonly. Currently, the API does not allow to set this flag, so basically it is of not much use today.

dateFile/folder date. Null if not exists.
sizeFile/folder date. 0 if file/folder not exists.
scannedTells if the sub folders have been loaded. Ths is related to the populateDepth parameter.
filesOnly exists if isdir is true. Array of file nodes contained in the present folder node.
foldersOnly exists if isdir is true. Array of folder nodes contained in the present folder node.

 

EXAMPLES

See this example:

...

dictionary
previewersA JSON object with each previewer system and whether it is enabled or not. Source and target documents include the information of the previewer system used. Hence this can be used to tell if the preview is possible or if it needs to be enabled or subscribed to first.object
previewersCanEnableBoolean. If true, the current user has the right to activate previewers that are not enabled. In Wordbee Translator this is done from the "Settings" page.bool
encodingsAn array of all encodings. Each encoding is an object with "v" (encoding code), "t" (user friendly title of encoding). This information can be used when creating deliverables or previewing files to choose an encoding for text based files.object[]
rm

Represents the project reference material. See description of node further down.

This node is null if either (a) the scope is not a project or job scope, or (b) the user has no access to the reference material.

object?

 

Each item in locales has these properties:

locale

The locale.

string
isSourceTrue: This is the source language.bool
 
 
encoding

The encoding if the document is a text file (xml, json...). For example "utf-8". In some cases this information may not be available.

For binary formats such as Word or InDesign, the encoding is null.

string?



dvrequiredBoolean. True if the user must submit a deliverable. If true, the user can only approve if a physical file was set (see exists property on deliverable).bool
dvapprovedBoolean. True if the user confirmed that deliverable is done as expected. Includes case where user says no, I do not want to set a deliverable.bool



canDocSetBoolean. Tells if the deliverable can be set, renamed or deleted.bool
canDocDownload

Boolean. Right to download the file.

bool
canDocPreviewBoolean: Right to web preview the file.bool
canAttSetBoolean. User can set, rename, delete, manipulate attachments.bool



documentA file node describing the document.object
attachmentsA folder node that contains the attachments.object

 

The file/folder nodes form a tree structure. A folder node may have file node and folder node children.

isdir

True: This is a folder node

False: This is a file node

bool
nameName of file or folderstring
folderInternal identifier of the parent node. Folder IDs are required when manipulating files.string
existsBoolean. Tells if the file or folder actually exists. If this node is a deliverable, it will be prepopulated with all information (such as the expected name of deliverable) but the deliverable may not yet exist on the server.bool
readonly

Boolean. Tells if the file is readonly or not. The original file will be readonly. Currently, the API does not allow to set this flag, so basically it is of not much use today.

bool
dateFile/folder date. Null if not exists.date?
sizeFile/folder date. 0 if file/folder not exists.int
   
 File nodes only 
canPreview

Boolean. If true then the file can potentially be previewed in the browser. Use these methods for previewing:

  • resources/files/details : Get exact information on how to preview this file. This will tell if preview is "really" possible and which parameters such as encoding information needs to be supplied to the preview method below.
  • resources/files/preview : Obtain a URL to preview file online
bool
   
 Folder nodes only 
scannedTells if the sub folders have been loaded. Ths is related to the populateDepth parameter.bool
filesOnly exists if isdir is true. Array of file nodes contained in the present folder node.object[]?
foldersOnly exists if isdir is true. Array of folder nodes contained in the present folder node.object[]?
   

 

The rm node has these properties:

canSetTrue if the user can add/remove/rename reference material.bool
contentsThe files and folders contained in the reference material. This object has the same structure as file/folder nodes described above.object

 

EXAMPLES

See this example:

Code Block
{
  "did": 1865,
  "dsid": 367,
  "available": true,
  "name": "html.txt",
  "locales": {
    "en-US": {
      "locale": "en-US",
      "isSource": true,
      "canDocSet": false,
      "canDocDownload": true,
      "canDocPreview": true,
      "canAttSet": true,
      "dvrequired": false,
      "dvapproved": false,
      "document": {
        "folder": "doc:en-US",
        "name": "html.txt",
        "isdir": false,
        "exists": true,
        "readonly": true,
        "date": "2017-02-05T22:57:24.7403048Z",
        "size": 502,
        "scanned": true,
        "canPreview": false
      },
      "attachments": {
        "folder": "att:en-US\\html.txt_",
        "name": "",
        "isdir": true,
        "exists": true,
        "readonly": false,
        "date": "2017-04-05T07:53:11.3225939Z",
        "size": null,
        "scanned": true,
        "files": [
          {
            "folder": "att:en-US\\html.txt_",
            "name": "Html replace term.config",
            "isdir": false,
            "exists": true,
            "readonly": false,
            "date": "2017-02-06T14:51:48.9304819Z",
            "size": 11997,
            "scanned": true,
            "canPreview": false
          },
          {
            "folder": "att:en-US\\html.txt_",
            "name": "xyz.html",
            "isdir": false,
            "exists": true,
            "readonly": false,
            "date": "2017-04-03T15:06:34.2892225Z",
            "size": 11997,
            "scanned": true,
            "canPreview": true
          }
        ],
        "folders": [
          {
            "folder": "att:en-US\\html.txt_\\folder1",
            "name": "folder1",
            "isdir": true,
            "exists": true,
            "readonly": false,
            "date": "2017-04-05T07:53:02.523813Z",
            "size": null,
            "scanned": true,
            "files": [
              {
                "folder": "att:en-US\\html.txt_\\folder1",
                "name": "document.docx",
                "isdir": false,
                "exists": true,
                "readonly": false,
                "date": "2017-04-05T07:52:53.8390226Z",
                "size": 11997,
                "scanned": true,
                "canPreview": false
              }
            ],
            "folders": []
          }
        ]
      }
    },
    "zh-Hans": {
      "locale": "zh-Hans",
      "isSource": false,
      "canDocSet": true,
      "canDocDownload": true,
      "canDocPreview": true,
      "canAttSet": true,
      "dvrequired": false,
      "dvapproved": true,
      "document": {
        "folder": "doc:zh-Hans",
        "name": "html-out.txt",
        "isdir": false,
        "exists": false,
        "readonly": true,
        "date": null,
        "size": null,
        "scanned": true,
        "canPreview": false
      },
      "attachments": {
        "folder": "att:zh-Hans\\html.txt_",
        "name": "",
        "isdir": true,
        "exists": true,
        "readonly": false,
        "date": "2017-02-06T14:51:55.7070816Z",
        "size": null,
        "scanned": true,
        "files": [],
        "folders": [
          {
            "folder": "att:zh-Hans\\html.txt_\\NewFolder",
            "name": "NewFolder",
            "isdir": true,
            "exists": true,
            "readonly": false,
            "date": "2017-02-07T14:07:38.8219265Z",
            "size": null,
            "scanned": true,
            "files": [
              {
                "folder": "att:zh-Hans\\html.txt_\\NewFolder",
                "name": "NoBOMTest3.txt",
                "isdir": false,
                "exists": true,
                "readonly": false,
                "date": "2017-02-06T14:52:00.3383798Z",
                "size": 25,
                "scanned": true,
                "canPreview": false
              }
            ],
            "folders": []
          }
        ]
      }
    }
  },
  "rm": null,
  "previewers": {
    "MsgReader": {
      "enabled": true
    },
    "Browser": {
      "enabled": true
    },
    "CodeMirror": {
      "enabled": true
    },
    "Beebox": {
      "enabled": false
    },
    "MicrosoftLive": {
      "enabled": true
    },
    "Frontlab": {
      "enabled": false
    }
  },
  "previewersCanEnable": true,
  "encodings": [
    {
      "v": "UTF-8",
      "t": "UTF-8"
    },
    {
      "v": "UTF-16",
      "t": "UTF-16"
    },
    {
      "v": "ISO-8859-1",
      "t": "ISO-8859-1"
    },
    {
      "v": "WINDOWS-1252",
      "t": "WINDOWS-1252"
    },
    {
      "v": "US-ASCII",
      "t": "US-ASCII"
    },
    {
      "v": "MACINTOSH",
      "t": "MACINTOSH"
    },
    {
      "v": "IBM850",
      "t": "IBM850"
    },
    {
      "v": "ISO-8859-6",
      "t": "ISO-8859-6"
    },
    {
      "v": "WINDOWS-1256",
      "t": "WINDOWS-1256"
    },
    {
      "v": "X-MAC-ARABIC",
      "t": "X-MAC-ARABIC"
    },
    {
      "v": "ASMO-708",
      "t": "ASMO-708"
    },
    {
      "v": "DOS-720",
      "t": "DOS-720"
    },
    {
      "v": "ISO-8859-4",
      "t": "ISO-8859-4"
    },
    {
      "v": "WINDOWS-1257",
      "t": "WINDOWS-1257"
    },
    {
      "v": "IBM775",
      "t": "IBM775"
    },
    {
      "v": "IBM500",
      "t": "IBM500"
    },
    {
      "v": "ISO-8859-2",
      "t": "ISO-8859-2"
    },
    {
      "v": "WINDOWS-1250",
      "t": "WINDOWS-1250"
    },
    {
      "v": "IBM852",
      "t": "IBM852"
    },
    {
      "v": "X-MAC-CE",
      "t": "X-MAC-CE"
    },
    {
      "v": "EUC-CN",
      "t": "EUC-CN"
    },
    {
      "v": "GB2312",
      "t": "GB2312"
    },
    {
      "localev": "enHZ-GB-US2312",
      "isSourcet": true, "HZ-GB-2312"
    },
  "canDocSet": false,  {
      "canDocDownloadv": true"X-MAC-CHINESESIMP",
      "canDocPreviewt": true,
 "X-MAC-CHINESESIMP"
    "canAttSet": true},
    {
 "deliverableRequired": false,
      "deliverableApprovedv": false"BIG5",
      "documentt": {"BIG5"
      },
 "folder": "doc:en-US",  {
      "namev": "html.txtX-CHINESE-CNS",
        "isdirt": false,
"X-CHINESE-CNS"
    },
  "exists": true,  {
      "readonlyv": true"X-CHINESE-ETEN",
        "datet": "2017X-02-05T22:57:24.7403048Z",CHINESE-ETEN"
    },
    {
      "sizev": 502"X-MAC-CHINESETRAD",
      "t":  "scanned": trueX-MAC-CHINESETRAD"
    },
    },{
      "attachmentsv": {"ISO-8859-5",
        "foldert": "att:en-US\\html.txt_",
 ISO-8859-5"
    },
    {
      "namev": "ISO-8859-9",
        "isdirt": true,"ISO-8859-9"
      },
 "exists": true,  {
      "readonlyv": false,
 "WINDOWS-1251",
      "datet": "2017-02-06T14:51:51.7538074Z",WINDOWS-1251"
     },
  "size": null,  {
      "scannedv": true"KOI8-R",
      "t":  "filesKOI8-R":
[    },
    {
 {     "v": "KOI8-U",
      "foldert": "att:en-US\\html.txt_"KOI8-U"
    },
    {
       "namev": "Html replace term.configX-MAC-CYRILLIC",
      "t": "X-MAC-CYRILLIC"
    "isdir": false},
    {
       "existsv": true"ISO-8859-7",
      "t": "ISO-8859-7"
    "readonly": false},
    {
       "datev": "2017-02-06T14:51:48.9304819ZWINDOWS-1253",
      "t": "WINDOWS-1253"
    "size": 11997},
    {
       "scannedv": true"IBM737",
          }
"t": "IBM737"
    },
  ],  {
      "foldersv": []"IBM869",
      }"t": "IBM869"
    },
    "zh-Hans": {
      "localev": "zhX-MAC-HansGREEK",
      "isSourcet": false,"X-MAC-GREEK"
      "canDocSet": true},
      "canDocDownload": true,{
      "canDocPreviewv": true"ISO-8859-8",
      "canAttSett": true,"ISO-8859-8"
    },
 "deliverableRequired": false,   {
      "deliverableApprovedv": true"ISO-8859-8-I",
      "documentt": {"ISO-8859-8-I"
        "folder": "doc:zh-Hans" },
    {
      "namev": "html-out.txtX-MAC-HEBREW",
        "isdirt": false,"X-MAC-HEBREW"
     },
  "exists": true,  {
      "readonlyv": false"DOS-862",

       "datet": "2017-02-07T14:09:21.9940303Z"DOS-862"
    },
    {
      "sizev": 25"IBM861",
      "t":  "scannedIBM861":
 true   },
   }, {
      "attachmentsv": {
 "X-MAC-ICELANDIC",
      "foldert": "att:zh-Hans\\html.txt_",X-MAC-ICELANDIC"
        "name": "",},
    {
      "isdirv": true"EUC-JP",
        "existst": true,"EUC-JP"
    },
   "readonly": false,
  {
      "datev": "2017ISO-02-06T14:51:55.7070816Z2022-JP",
        "sizet": null,"ISO-2022-JP"
      },
 "scanned": true,  {
      "filesv": []"SHIFT_JIS",
        "folderst": ["SHIFT_JIS"
     },
    {

           "folderv": "att:zh-Hans\\html.txt_CSISO2022JP",
      "t": "CSISO2022JP"
    "name": "NewFolder"},
    {
      "v": "isdir": trueX-MAC-JAPANESE",
      "t": "X-MAC-JAPANESE"
    "exists": true},
     {
      "readonlyv": false"KS_C_5601-1987",
            "date"t": "2017-02-07T14:07:38.8219265Z"KS_C_5601-1987"
    },
     {
      "sizev": null"EUC-KR",
      "t": "EUC-KR"
    "scanned": true},
     {
      "filesv": ["ISO-2022-KR",
      "t": "ISO-2022-KR"
    },
 {   {
      "v": "JOHAB",
     "folder": "att:zh-Hans\\html.txt_\\NewFolder", "t": "JOHAB"
    },
    {
      "namev": "NoBOMTest3.txtX-MAC-KOREAN",
      "t": "X-MAC-KOREAN"
    },
   "isdir": false, {
      "v": "ISO-8859-3",
       "t": "existsISO-8859-3":
true,    },
     {
      "readonlyv": false"ISO-8859-15",
                "date"t": "2017ISO-02-06T14:52:00.3383798Z",8859-15"
    },
    {
      "sizev": 25"WINDOWS-874",
      "t": "WINDOWS-874"
    },
   "scanned": true{
      "v": "WINDOWS-1254",
      }
"t": "WINDOWS-1254"
    },
    {
 ],     "v": "IBM857",
      "folderst": []"IBM857"
    },
    {
}      "v": "WINDOWS-1258",
 ]       }"t": "WINDOWS-1258"
    }
  }]
}

...