This method permits to submit new orders to the client portal.
This method does not provide all the features that you get when submitting orders online (alternative full-feature methods will be added over time).
URL
(POST) /api/orders/create
PARAMETERS
The BODY must be of type form-data
and contain two elements:
data: A JSON object where you include all the various parameters, explained below.
zipFile: The ZIP archive that contains the files to translate or attach as reference material. See further down for explanation.
In Postman, this is done as follows:
Order parameters (“data”)
This is a JSON object with these properties:
client | A JSON object containing the company submitting the order and, optionally, the person within the company. Example: "client" : { "companyId": 100, "personId": null } To find companies or persons use companies/list and persons/list
| object {int, int?} , Mandatory |
option | The zero-based “option” to select in the order form. An order form may have one (default) or more options a client can choose from. These are configured in Settings > New Order form. If an order form has more than one option, the following option-selector appears: Note: The client ID you have chose directly defines the order form configuration that is selected and which influences how the order will be created. | int, Mandatory |
deadline | The deadline. Always set to a future date and note that this date may get adjusted according to various options in the order form configuration. This date must be UTC. | datetime, Mandatory |
isDeadlineByFiles | Optional, default is false. If you would like to assign individual deadlines to each file uploaded to the order then:
| bool?, Optional |
reference | The order reference provided by the client. | string, Mandatory |
sourceLanguage | The source language code such as “en” or “fr-BE”. | string, Mandatory |
targetLanguages | An non-empty array of target language codes. Example: "targetLanguages": [ "fr", "de-DE" ] | string[], Mandatory |
domains | Optional. An array of translation domains to assign to the project. | string[]?, Optional |
instructions | Optional instructions included by client. | string?, Optional |
Appointment specific fields | ||
isAppointment | Optional, false by default. Indicates if this order is an “appointment” request such as a request for interpretation. This requires a specific setup in the order form settings. The date when the appointment starts. | bool?, Optional |
appointmentStartDate | Optional. This field is used with appointments only. The date when the appointment starts. | datetime?, Optional |
appointmentEndDate | Optional. This field is used with appointments only. The date when the appointment ends. | datetime?, Optional |
Custom fields | ||
customFields | Optional array of custom fields to populate. Any custom field defined for Orders can be used. Each array element is an object with properties:
See settings/customfields to enumerate custom fields by API and get the IDs (keys). The “key” can also be found in the Wordbee Translator user interface, see Creating and updating Custom Fields. Go to “Settings” then “Custom fields”, select the “Orders” tab and pick any of the fields. At the bottom of the popup you will find the custom field’s ID. Example: "customFields": [ { "key": "CustomStr4", "text": "my value" }, { "key": "CustomStr1", "text": "https://alpha/1000" } ] | object[{string, string?}], Optional |
Management | ||
manager | Optional. The user ID of the project manager to assign to this order. If not specified no manager is assigned. The ID must refer to an internal user with manager level access rights. See persons/list to enumerate or find persons. | int?, Optional |
parserProfileId | Optional. Generally, this should not be used. The parser profile ID to be used to extract content from the uploaded files. The order form configuration typically lets you define this profile. But, you can override this as well. To find or enumerate available profiles, see: Document format profiles | int?, Optional |
Files | ||
files | An array of files to include with the order. These are either files to translate or files to attach as reference material. The files listed here must exist in the ZIP archive that you can attach to the body of this API request. See further down. Each array element is an object with these properties:
For reference material the relative path of the file must start with | object[{string, datetime?}], Optional |
Example:
{ "reference": "order-name", "client": { "companyId": 5404018 }, "option": 0, "sourceLanguage": "en", "targetLanguages": ["pl-PL", "es-ES"], "deadline": "2018-08-02T00:00:01.0000000Z", "files": [ { "name": "xxxxxxxxx.html" }, { "name": "___ref___\\xxxxxxxxxx.xml" } ], "customFields": [ { "key": "CustomStr1", "text": "My value" } ] }
ZIP archive (“zipFile”)
Include the ZIP file in the BODY form-data with key zipFile
The archive combines all the files declared in the files property you added in the JSON payload (the data object).
To add reference material, create a folder named ___ref___ to your zip file and place your reference files. Optionally, add "___ref___/" before the file name.
Example:
The ZIP archive might contain these files:
file1.docx file2.docx IGNORE-ME.whatever marketing/presentation.pptx ___ref___/instructions.docx
The files node would then declare the files we want to include:
"files": [ "file1.docx", "file2.docx", "marketing\\presentation.pptx", "___ref___\\instructions.docx" ]
RESULTS
The method executes asynchronously. It returns the id of the asynchronous operation or 0 if the operation has completed immediately:
THIS SECTION IS UNDER CONSTRUCTION