PUT Job - TextKing/textking-api GitHub Wiki

PUT /project/{projectId}/job/{jobId}

Request: PUT /project/{projectId}/job/{jobId}

Updates an existing job with the given ID. You can only modify jobs if the job’s project has the state prepared.

When updating a job you can set the following attributes:

  • name: The job name (required, can be any non-empty string).
  • source_language: The ISO 639 language code of the source language (required).
  • target_language: The ISO 639 language code of the target language (required).
  • quality: The type of translation, can be either translation or =translation-and-correction” (required).
  • topic: Any topic ID
  • briefing: A string containing further briefing information for the job.
  • is_active: A boolean flag indicating whether this job is active or not. Inactive jobs will be ignored when the project is started and will not get translated. Default true.

Request headers

Header Description
Authorization oAuth 2 authentication header
Accept application/json or application/xml
Content-Type The content type of the posted data (application/json or application/xml)

Response status codes

HTTP status Description
200 Ok The job was successfully updated, the Content-Location header contains the URI of the updated job.
400 Bad Request The input data was incomplete or contained errors.
403 Forbidden You are not allowed to update the job, e.g. when the corresponding project’s state is not prepared.
404 Not Found The job or project with the given ID does not exist.

Example

Set a new topic and briefing for the job with the ID be2bdb76-afe4-4291-bb33-5f3e4019a05e:

PUT /v1/bc141454-5949-401b-9c05-7591ee2f5624/job/be2bdb76-afe4-4291-bb33-5f3e4019a05e HTTP/1.1
Host: api.textking.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer youraccesstoken

{
    "topic": "49353ab0-fdbf-4e1c-a063-cdf4aad98782",
    "briefing": "Some remarks for the translator"
}

Response:

HTTP/1.1 200 Ok
Content-Type: application/json; charset=utf-8
Location: https://api.textking.com/v1/project/bc141454-5949-401b-9c05-7591ee2f5624/job/3bfaa57a-7385-4fec-ae1a-ba2c6bea5679
Content-Location: https://api.textking.com/v1/project/bc141454-5949-401b-9c05-7591ee2f5624/job/3bfaa57a-7385-4fec-ae1a-ba2c6bea5679

{
    "id": "3bfaa57a-7385-4fec-ae1a-ba2c6bea5679",
    "number": null,
    "name": "My new translation job DE -> EN",
    "source_language": "de",
    "target_language": "en",
    "quality": "translation",
    "topic": "49353ab0-fdbf-4e1c-a063-cdf4aad98782",
    "briefing": "Some remarks for the translator",
    "state": "new",
    "words": null,
    "net_price": null,
    "currency": null,
    "is_active": true,
    "links": [
        {
            "rel": "self",
            "href": "https://api.textking.com/v1/project/bc141454-5949-401b-9c05-7591ee2f5624/job/3bfaa57a-7385-4fec-ae1a-ba2c6bea5679"
        },
        {
            "rel": "urn:textking:project",
            "href": "https://api.textking.com/v1/project/bc141454-5949-401b-9c05-7591ee2f5624"
        },
        {
            "rel": "urn:textking:topic",
            "href": "https://api.textking.com/v1/topic/49353ab0-fdbf-4e1c-a063-cdf4aad98782"
        }
    ]
}
⚠️ **GitHub.com Fallback** ⚠️