resources/files/list

resources/files/list

Gets files related information for all or a subset of the documents in the scope:

  • Document name

  • Locales with status information for deliverable

URL

(POST) /resources/files/list

PARAMETERS

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.

Mandatory, object

skip

Optional. 0 by default. To paginate items. Upon first call set to 0.

Optional, int?

take

Optional. 20 by default and unlimited for job scopes. Upon first call simply omit. The method will send back info on pagination etc.

Optional, int?

locales

Null or an explicit list of locales to get info for.

If null will return information for all scope locales.

Optional, string[]?

did

Optional filter on a specific document. If specified the system returns information for this specific document only.

Note: If the document does not exist, an error is returned.

Optional, int?

 

RESULTS

The message body contains a JSON object:

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!

skip

When navigating, the first document in list shown

take

Number of document fetched

hasMore

True if there are more documents. In that case navigate using the skip and take params.

This method is implemented so that you always get ALL documents for jobs but only up to 20 for other scope types.

documents

An array of document objects.

 

Each item in documents has these properties:

did

Document id.

int

dsid

Document set id.

int

name

The source document name or the deliverable name (depending on language)

string

src

Boolean. The source locale of this document.

string

domain

The parser domain code, such as HTML, PLAINTEXT, etc.

string

locales

An array with document details per language, see below.

Sorted alphabetically with source language ALWAYS on top.

object[]

 

The locales array items have these properties:

locale

Language code.

string

localet

Language name.

string

isSource

True if this is the source language of the document. The source language item is always shown in first position.

bool

name

The original file name or the deliverable name. Note that deliverables can be renamed by the user.

string

dvrequired

Boolean. 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

dvapproved

Boolean. 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

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?

 

EXAMPLES

See this example:

{ "available": true, "skip": 0, "take": null, "hasMore": false, "documents": [ { "did": 1520, "dsid": 296, "name": "thu_trade_test_doc.htm", "src": "en", "domain": "HTML", "locales": [ { "locale": "en", "localet": "Anglais", "isSource": true, "name": "trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" }, { "locale": "sq-ALS", "localet": "Albanais (Tosque)", "isSource": false, "name": "thu_trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" }, { "locale": "my", "localet": "Birman", "isSource": false, "name": "thu_trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" }, { "locale": "fr", "localet": "Français", "isSource": false, "name": "thu_trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" } ] }, { "did": 1448, "dsid": 296, "name": "trade_test_doc.htm", "src": "en", "domain": "HTML", "locales": [ { "locale": "en", "localet": "Anglais", "isSource": true, "name": "trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" }, { "locale": "sq-ALS", "localet": "Albanais (Tosque)", "isSource": false, "name": "trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" }, { "locale": "my", "localet": "Birman", "isSource": false, "name": "trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" }, { "locale": "fr", "localet": "Français", "isSource": false, "name": "trade_test_doc.htm", "dvrequired": false, "dvapproved": false, "encoding": "utf-8" } ] } ] }

 

 

 

Copyright Wordbee - Buzzin' Outside the Box since 2008