Skip to content
phw edited this page Oct 12, 2012 · 9 revisions

POST /project/{projectId}/jobs

Request: POST /project/{projectId}/jobs

Creates a new job with the state new for the project specified by projectId and returns the result in the response body. You can only add jobs to projects in the state prepared.

When creating a new job you can set the following attributes:

  • name: The job name (required, can be any non-empty string).
  • source_language: The ISO 639-2/T language code of the source language (required).
  • target_language: The ISO 639-2/T 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
Authorize 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
201 Created The project was successfully created, the Content-Location header contains the URI of the created project.
400 Bad Request The input data was incomplete or contained errors.

Example

Create a new project with the name “My Translation Project” and the due date November 16th 2012:

POST /v1/projects HTTP/1.1
Host: api.textking.com
Accept: application/json
Content-Type: application/json
Authorize: Bearer youraccesstoken

{
    "name": "My Translation Project",
    "due_date": "2012-11-16"
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Location: https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2
Content-Location: https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2

{
    "id": "29163f4f-7c8f-4baf-adf3-753c1df429c2",
    "number": null,
    "name": "My Translation Project",
    "due_date": "2012-11-16T00:00:00",
    "state": "prepared",
    "currency": "EUR",
    "net_price": null,
    "vat": null,
    "coupon_name": null,
    "coupon_value": null,
    "discount_customer": null,
    "discount_project": null,
    "affiliate_id": null,
    "billing_address": "9c6f23b6-167d-4b01-977f-4de799e3abf3",
    "links": [
        {
            "rel": "self",
            "href": "https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2"
        },
        {
            "rel": "urn:textking:jobs",
            "href": "https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2/jobs"
        },
        {
            "rel": "urn:textking:line_items",
            "href": "https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2/line-items"
        },
        {
            "rel": "urn:textking:billing_address",
            "href": "https://api.textking.com/v1/account/address/9c6f23b6-167d-4b01-977f-4de799e3abf3"
        }
    ]
}
Clone this wiki locally