Creates a new random sample for jobs of a specific supplier. Use cases:
...
(POST) /resources/segments/sampling/new
PARAMETERS
The parameters are a JSON object included in the request body:
type | Value must be: Supplier | Mandatory, string |
cid | The supplier company id. See companies/list to list all companies or find companies by name. | Mandatory, int |
uid | The optional supplier user id. Specify with internal workers, in addition of the company id for your platform company. | Optional, int? |
dsid | Optional project memory resource id. Use if you want to get segments for the supplier in a specific project. To enumerate or find projects use projects/list | Optional, int? |
dtfrom dtto | Selects supplier's jobs completed between dtfrom and before dtto. Both dates are UTC. | Mandatory, datetime |
src | The source locale (language code). Only jobs in this source language are considered. | Mandatory, string |
trg | The target locale (language code). Only jobs in this target language are considered. | Mandatory, string |
tsk | The task code such as "TR", "RV" etc. Only such jobs are considered. | Mandatory, string |
size | The expected sample size. Default is 10. This must be a value between 1 and 50. | Optional, int? |
layout | Optionally specify the segments' fields to include in the results. This is done using a layout JSON object. If not specified, the system will include:
| Optional, object? |
persist | Optional boolean. Default is false. Only set to true if required. If true, then the results are temporarily saved and assigned a token (see sampletoken in results). | Optional, bool? |
includeresults | Optional boolean. Default is true. If true then the returned JSON includes the result node. Otherwise only the summary statistics are returned. If you further process results using the sampletoken you may not need the results with this call. | Optional, bool? |
...
Excerpt | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
You can further fine tune the sample with these additional parameters:
|
RESULTS
NOTE: If parameters are invalid or no job could be filtered then you get an error message. See next chapter on how jobs are selected.
A JSON with these properties:
...
segments | Total segments in sample. Note that this number will be less than the expected sample count if there is no or not enough data or the filter is too restrictive. | int |
words | Total source text words in sample. | int |
tsk | The task code such as "TR", "RV" etc. of the sample. | string |
src | The source language of the sample | string |
trg | The target language of the sample | string |
cid | The supplier company id | int |
uid | The internal supplier person id. Null with external suppliers. | int? |
dtfrom, dtto | The date range of the sampled jobs. We recommend that you format dates with a timezone indication or "Z" for UTC. For example:
You can however also provide simpler dates such as "2018-10-10". | datetime? |
result | Contains all the segments in the sample, information on the resources to which the segments belong as well as worker names.
| object[] |
result.rows | The list of segments. Includes main segment properties as well as the data columns specified in the layout parameter. The format is explained further down in this page. | object[] |
result.docs | A dictionary with all documents that appear in the results. This permits to show document names and more information per segment (see the did property of a segment). The format is explained further down in this page. | object |
result.users | A dictionary with all users/persons that are referenced by the segments included with the results. A segment references the persons that have last changed a text, a status, a bookmark etc. The format is explained further down in this page. | object |
columns | An array with the columns in the result.rows property. Each array element describes one column, see here: Spreadsheet Column (Object) | object[] |
JOB SELECTION
You receive an error message if your filters did not select any job. This is how jobs are selected:
- The job must be completed
- The job completion date must be within dtfrom and dtto
- The job source / target language must exactly match parameters src and trg
- The job task type must exactly match parameter tsk
- The job must be assigned to company cid
- If you set optional parameter pid then the jobs must further be assigned to this person
- If you set optional parameter dsid then the jobs must be part of the project or more precisely the project memory resource
ACCESS RIGHTS
The user must have administrator or manager level credentials.
...