Upload new document or new document version
This method permits to insert a new document to a Codyt project. If you want to replace an existing document with a new version then specify an existing document path/name.
Word counting and pre-translation is executed according to the project settings.
This method requires that you first upload the file to the server (see Upload file). The method executes asynchronously and you need to poll the operation's status to know when it terminates (see Asynchronous operations).
URL
(PUT) projects/{PROJECTID}/documents/codytdocument2?token={TOKENID}
PARAMETERS
tokenid | The token obtained on connection | Required |
projectid | The project id | Required |
name | The path/name under which the new document will be stored to the document library. The path/name must be unique within a project. If a document with the same path already exists, an error will be returned. Note: The path/name should not start with '\' i.e.: - "\\Path1\\Doc.docx" is not a valid. - "Path1\\Doc.docx" is valid. | Required |
version | A user defined and optional version information. | Optional |
sourcelocale | The language of the document. Must be one of the project's languages. | Required |
targetlocales | The list of languages into which the document needs to be translated. Must be project's languages. The list can be empty if languages are specified at a later stage. | Required |
parserconfig | The name of the parser configuration for the ParserDomain document format. If empty, the default configuration is selected. Otherwise specify an existing configuration name. | Optional |
parserdomain | Indicates the document format. See Document formats (Parser domains) for available formats. | Required |
wcid | Optional word count profile ID to apply. By default (recommended) the system uses the profile saved with the project, see project details page. Set this value if you want to apply a different profile. All defined profiles can be enumerated using: Word count profiles If you specify an invalid/inexistant ID, the system automatically disregards the parameter and no error is returned. NOTE: If you set this parameter you should select a profile that uses the same fuzzy match intervals as the project itself. Otherwise, the word counts will not be saved correctly. All other parameters in the profile may be different from the project's profile. | Optional |
workflow | Specifies the workflow to be applied to the new document. The possible values are listed below. The recommended value is "ReuseAll". /// <summary> /// Do not create a workflow, i.e. do not create any tasks /// </summary> None /// <summary> /// Create tasks and calculate deadlines according to the project default workflow settings /// </summary> ProjectDefault /// <summary> /// For adding new document versions only. /// Same as ProjectDefault but furthermore re-assign tasks to the same workers as the previous version ./// Requires that the new document has a previous version. /// </summary> ProjectDefaultReuseWorkers /// <summary> /// For adding new document versions only. /// Create same workflow as previous version and assign same workers. /// </summary> ReuseAll | Required |
workflowstart | If not set then the workflow is kicked off immediately. Otherwise specify a future UTC date. | Optional |
workflowname | Optional. The name of a workflow template configured in the "Settings" section of Wordbee Translator. If not specified, then the default workflow configured in the project is used. Do not set "workflow" to "None" if you use this parameter. | Optional |
docreference | A user defined and optional document reference which can be used as an alternative user-defined document identifier. The system does not require this reference to be unique within a project. | Optional |
notify | Put "1" to enable sending out notifications to suppliers. Notifications are only sent if the project workflow setup is configured for group or crowd proposal work steps. For example, if the workflow has a translation step to be assigned to a group of translators, then the translators are notified immediately to work on this new document.Default if not specified: "1" | Optional |
cost | Put "1" to automatically calculate supplier costs. This parameter only applies when uploading new document versions and the same workers are assigned once again. In that case the system can cost the new work items. Default if not specified: "1" | Optional |
domachinetranslate | Default: null If true, then segments not pretranslated during the wordcounting process will be pretranslated using machine translation. If a system is defined in the wordcount settings used to do this wordount, and this system can machine translate the current language couple, then it will be used. If this system cannot pretranslate the language couple or no systems are defined, then the system will pick the first one that can translate the current language couple from the platform configuration. | Optional bool? |
orderid | Optional. Used to link the document to a specific order in the project. This is the (internal incremental) OrderId value. See also ApiOrder Note: Setting the ID of an inexistant order or an order not related to the project, then the system simply disregards the parameter (you will receive no error message). | Optional, int? |
HTTP BODY | Include the binary stream of the document in the body of the HTTP POST request. | Required |
RESULTS
The method executes asynchronously. It returns the id of the asynchronous operation or -1 if the operation has completed immediately:
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">2147483647</int>
If not -1 then your software should poll the status of the operation every 5 seconds. See Asynchronous operations, operation "asyncoperations/{operationid}/status".
USING POSTMAN
To upload the file please choose the "Binary" option to include the file as a binary stream:
Set the content type:
Alternatively, if the file is binary (do not use with html files), then use: