apps/wbflex/documents/{id}/components/status

This method retrieves a list of components that are fully translated in one or more languages since a specified date/time.

The method makes it easy to retrieve or deliver translations by component and language. Rather than pulling partially translated components you can now pull only full translated components.

Use cases:

  • Get fully completed components individually by language. For example, French is finished now but maybe Spanish is not yet.

  • Get fully bookmarked components individually by language. This is useful if your workflow requires bookmarks to be set to flag “ready for delivery” (rather than resetting the segment translation status).

URL

(POST) /api/apps/wbflex/documents/{id}/components/status

PARAMETERS

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.

All filter options are optional. If you do not specify a filter you will receive every single component appearing in the document.

If you specify filters then you will receive the components of the filtered segments.

changed

Mandatory date.

The method filters components and languages where any segment in the language was modified at or after this date. For example you will then receive all components and translations that are newly completed since recently.

Note: The date must be at maximum 7 days into the past.

Example:

{ "changed": "2021-10-01T00:00:00Z" }

 

datetime, Mandatory

metric

Identifies which languages in a component shall be returned. The options are:

  • StatusNoneOk : Translations in a component must all be in status “gray” or “green” (and none in “red”). Permits to select components that are fully translated.

  • StatusOk : Translations in component must all be in “green” status. Permits to select components that are fully translated and flagged “green”.

  • BookmarkBlue : Translations must all be bookmarked with the blue color. If your workflow requires that translators or revisers flag completely finished translations with a bookmark then this is the way to go.

If not specified then StatusNotOk is used.

Example: Select those components and languages where translation were finished between changed and now:

{ "metric": "StatusNoneOk" }

 

string?, Optional

invert

When false (default), the metric operates as described above.

If true then the method returns the languages that do not satisfy the metric requirement.

Example: Select those components and languages that were edited since changed but remain unfinished:

 

bool?, Optional

locales

Optional list of locales. If not specified, the system uses all Flex document target languages.

With this property you can restrict the results to a subset of languages. The list can also contain the source language.

Example:

string[]?, 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

callbackurl, callback

Specify a URL which will be called upon success or failure of operation. This makes polling for operation status unnecessary. See Callbacks (with asynchronous operations)

Optional

RESULTS

Wait for results

The API method returns an Asynchronous operation result:


You can poll the status or use the callback parameter. When the operation is complete, the results are in the custom property


The components is the total number of filtered components. To download the actual results (list of components) pass the filetoken to this method:media/get/{token} :

Obtaining results

As described above, you use media/get/{token} to download the final results.

These are a JSON array with the list of filtered components. Each element has these properties:

  • k : The component ID.

  • s : Total segments in this component.

  • l : List of locales that satisfy the selected metric.

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: We see 1 component that was translated into German and French and 1 component that was translated into German since the last week (if you set the changed-date to a week ago).

Pulling the segment details

Once you identified completed components / languages, you can download these.

Use apps/wbflex/documents/{id}/contents/pull and simply populate the components property.

 

EXAMPLES

Find components and languages that were completed since 24 hours and I can deliver back to my client

The API call would be:

Find components and languages that were modified since 24 hours but are still not complete

The API call would be:

 

 

Copyright Wordbee - Buzzin' Outside the Box since 2008