This method retrieves a list of components from a Flex document. It includes the number of segments in each component.
Use cases:
List all components with total segments each.
List all components that contain translations in error status.
List all components containing bookmarked translations.
URL
Code Block |
---|
(POST) /api/apps/wbflex/documents/{id}/components |
...
URL Parameters
The URL parameters are:
id | Specify either a document ID (such as 1000) or a job ID (such as c300). | string, Mandatory |
Body
The body must contain a JSON object with optional filters.
...
If you specify filters then you will receive the components of the filtered segments.
locales | Optional list of locales. If not specified, the system uses all Flex document target languages. This property is only used to delimit all other filters below to specific languages. Using more than one language means that a filter must apply in at least one of those languages in a segment for the segment to be retained. It does NOT mean that the filters below must apply to ALL languages! Example to restrict to 2 languages:
| |||
status | Optional list of numeric translation statuses. See Text Status (Enumeration) Example to filter translations with errors (red status):
| int[]?, Optional | ||
bookmarks | Optional list of numeric bookmark statuses. See Text Bookmark (Enumeration) Example to filter translations bookmarked in either gray or blue:
| int[]?, Optional | ||
components | Optional list of component IDs. By default this is null. If specified, the method will only dig into these components. Example to filter translations bookmarked in either gray or blue:
Note: You can specify up to 500 elements. | string[]?, Optional | ||
component | Optional filter on components using a prefix, suffix, infix, wildcard or regex pattern. See String filter (Filter) for details. Example to filter all components starting with “frontend.”. It captures “frontend.ux”, “frontend.page1.js” etc.
| object?, Optional | ||
dtchange | Optional filter on the last change of a translation or its properties. See details here: Date filter (Filter) Filter changes at or after October 2021:
Filter changes since 3 days:
| object?, Optional | ||
callbackurl, callback |
Specify a URL which will be called upon success or failure of operation. This makes polling for |
Code Block |
---|
"callbackurl": "http://callmeback.mycompany.com?operationid=22222&mydata=abcde" |
operation status unnecessary. See Callbacks (with asynchronous operations) | Optional |
RESULTS
Awaiting results
The API method returns an Asynchronous operation result:
...
k : The component ID.
s : Total filtered segments with this component ID.
Note: We count the segments as they appear in the translation editor. For example, a Flex segment may be split into multiple segments in Wordbee to ease translation.
Example:
Code Block |
---|
[ { "k": "pages.welcome", "s": 21 }, { "k": "pages.login", "s": 16 }, { "k": "pages.login.sso", "s": 16 } ] |
...