Request: Post Project¶
Incoming API project requests are added as new projects in LanguageDesk
POST to https://app.languagedesk.com/api/v1/projects
Field | Possible Values | Required? | Comment |
---|---|---|---|
contact_person | Valid email address of a user registered on Languagedesk. | Yes | This user will be made the project owner in LanguageDesk and will be contacted in case of problems or questions. |
source_language | Langauge code (see list below) | Yes | |
target_language | Langauge code (see list below) | Yes | |
content_identifier | String, max. 20 characters | Yes | This identifies the product, content type or source of the translated content. |
file_transfer_method | ftp-pull-http-push | Yes |
|
host | valid host name (without protocol) | Required only if file_transfer_method is ftp-pull | |
files->source_path | path on the FTP server where files to be translated can downloaded. | Required only if file_transfer_method is ftp-pull | |
files->target_path | path on the FTP server where translated files should be pushed to. | Required only if file_transfer_method is ftp-pull | |
files->name | Name of file to be translated | Yes | |
files->remove | Flags the file to be deleted after projects request doen and project created. | Yes | True or False |
files->md5_checksum | MD5 checksum of the file | Required only if file_transfer_method is ftp-pull | If provided, will perform a check to verify that the file transfer has been completed without errors. |
directories->{remove:true|false, source_paths: [/import, import2], target_path: /export} | Source directories that have the source files. Target is where the files are saved back upon delivery | Required only if file_transfer_method is ftp-pull | It provides a way to specify source directories to be copied from the FTP server to compress into a source work zip file and the target path to upload deliveries back. |
mode | container | No | To be implemented in v2 If not present uses default action and creates new project. If value container, it updates the project. |
instructions | Allows to fill in project instrucitons | No | Allows to fill in project instructions when there are multiple source languages per zip file. |
company_id | integer | No | Used when a user belongs to more than one client company. |
The following fields are not part of the request and will be generated automatically as follows in the project:
- Project name: [content identifier] [DD/MM/YYYY hh:mm] [source_language_code] [target_language_codes, comma separated] (API requests)
- Deadline: Same datetime as the request itself (rounded up to the next hour, as deadline needs to be in the future)
- All other project fields are left blank
Note: The project will be created in exactly the same way as a manually created project. The only difference is that no email notification will be send to the client contact person of the project.
Field | Possible values | Comment |
---|---|---|
project.id | string | The project number of the project the request was added to. Can be used later to retrieve translated content. |
project.status | string | Project status after new request being added into container |
status | integer | HTTP error code |
message_code |
|
Possible error messages when creating or adding into project |
message | string | Textual description of error to present to user |
company_id | integer | Project company ID |
Example requests¶
Scenario 1: Project details are submitted via HTTP API request, LanguageDesk then pull the actual files to translate from the provided FTP server (credentials are stored encrypted in the LanguageDesk database).
{
"project": {
"contact_person": "user@client.com",
"content_identifier": "Website",
"source_language": "en",
"target_languages": ["de-DE","en-GB"],
"file_transfer_method": "ftp-pull",
"host": "hotfolder.languagedesk.com",
"company_id": "12345",
"files": {
"1": {
"source_path": "/path1/",
"target_path": "/path1_target/",
"name": "file_english_name_1.doc",
"md5_checksum": "e696b5aed3fca73e381d86a054706485"
},
"2": {
"path": "/path2/",
"name": "file_english_name_2.doc",
"md5_checksum": "b7006a65aed3fca73e381d86a054706678"
}
}
}
}
or…
{
"directories": {
"remove_source_path": true,
"source_path": ["/import", "/import2"],
"target_path": "/export"
},
"mode": "container"
}
Scenario 2: Project details and files are submitted via HTTP API request.
{
"project": {
"contact_person": "user@client.com",
"content_identifier": "Website",
"source_language": "en",
"target_languages": ["de-DE", "en-GB"],
"file_transfer_method": "http-push",
"company_id": "12345",
"files": {
"1": {
"name": "file_english_name_1.doc",
"file": "<tmp/multipart uploaded file>"
},
"2": {
"name": "file_english_name_2.doc",
"file": "<tmp/multipart uploaded file>"
}
}
}
}
Sample script (Python)
Example responses¶
Example response 1 (OK)
{
"status": 200,
"project": {
"id": "23456",
"company_id": "12345",
"status": "in_progress"
}
}
Example response 2 (ERROR)
{
"status": 400,
"messages": {
"missing_target_languages": "missing target languages",
"content_identifier": "Can't be blank",
"files": "Can't be blank"
}
}