Job methods

This describes the endpoints that deal with singular Job tasks and information on Gengo API.

Job (GET)

Summary :

Retrieves a specific job.

URL :

http://api.gengo.com/v2/translate/job/{id}

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Data arguments :
  • id (required) - Job ID

Note
  • If the job is a file job, the response will include file_url_src and file_url_tgt

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13gengo.getTranslationJob(id=42)

Response

 1{
 2  "opstat": "ok",
 3  "response": {
 4    "job": {
 5      "job_id": 384985,
 6      "credits": 0.05,
 7      "auto_approve": 0,
 8      "eta": 25056,
 9      "file_download_ready": false,
10      "order_id": 54632,
11      "lc_tgt": "ja",
12      "unit_count": 1,
13      "lc_src": "en",
14      "slug": "APIJobtest",
15      "callback_url": "http://gengo.callback/",
16      "currency": "USD",
17      "tier": "standard",
18      "body_src": "This is text.",
19      "body_tgt": "これはテキストです。",
20      "ctime": 1313475693,
21      "status": "available"
22    }
23  }
24}

Job (PUT)

Summary :

Updates a job to translate. Request should be no larger than 100MB. Comments should not exceed more than 25,000 characters.

URL :

http://api.gengo.com/v2/translate/job/{id}

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Data arguments :
action (required) :
“revise“ - Returns this job back to the translator for revisions.

Other parameters

  • comment (required) - The reason to the translator for sending the job back for revisions.

“approve“ - Approves job.

Other parameters

  • rating (optional) 1 (poor) to 5 (fantastic)

  • for_translator (optional) - Comments for the translator

  • for_mygengo (optional) - Comments for Gengo staff (private)

  • public (optional) 1 (true) / 0 (false, default) - Whether Gengo can share this feedback publicly, including the source and target text (see Open Data).

“reject“ - Rejects the translation. Please see our FAQs for details of the rejection process.

Other parameters

  • reason (required) - “quality”, “incomplete”, “other”

  • comment (required)

  • follow_up (optional) “requeue” (default) or “cancel” - If you choose “requeue” the job will be rejected and then passed onto another translator. If you choose “cancel” the job will be completely cancelled upon rejection.

“archive“ - Archive approved job.

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13gengo.updateTranslationJob(
14    id=42,
15    action={
16        'action': 'reject',
17        'reason': 'quality',
18        'comment': 'My grandmother does better.',
19    }
20)

Response

1{
2  "opstat": "ok",
3  "response": {
4
5  }
6}

Job (DELETE)

Summary :

Cancels the job. You can only cancel a job if it has not been started already by a translator.

URL :

http://api.gengo.com/v2/translate/job/{id}

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Data arguments :
  • id (required) - Job ID

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13gengo.deleteTranslationJob(id=42)

Response

1{
2  "opstat": "ok",
3  "response": {
4
5  }
6}

Revisions (GET)

Summary :

Gets list of revision resources for a job. Revisions are created each time a translator or Senior Translator updates the text.

URL :

http://api.gengo.com/v2/translate/job/{id}/revisions

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13print(gengo.getTranslationJobRevisions(id=42))

Response

 1{
 2  "opstat": "ok",
 3  "response": {
 4    "job_id": 42,
 5    "revisions": [
 6      {
 7        "rev_id": 1234,
 8        "ctime": "..."
 9      },
10      {
11        "rev_id": 1235,
12        "ctime": "..."
13      },
14      {
15        "rev_id": 1236,
16        "ctime": "..."
17      },
18      "..."
19    ]
20  }
21}

Revision (GET)

Summary :

Gets a specific revision for a job.

URL :

http://api.gengo.com/v2/translate/job/{id}/revision/{rev_id}

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13print(gengo.getTranslationJobRevision(id=42, revision_id=1))

Response

1{
2  "opstat": "ok",
3  "response": {
4    "revision": {
5      "body_tgt": "...",
6      "ctime": "..."
7    }
8  }
9}

Feedback (GET)

Summary :

Retrieves the feedback you have submitted for a particular job.

URL :

http://api.gengo.com/v2/translate/job/{id}/feedback

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Data arguments :
  • id (required) - Job ID

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13print(gengo.getTranslationJobFeedback(id=42))

Response

1{
2  "opstat": "ok",
3  "response": {
4    "feedback": {
5      "for_translator": "...",
6      "rating": 8
7    }
8  }
9}

Comments (GET)

Summary :

Retrieves the comment thread for a job.

URL :

http://api.gengo.com/v2/translate/job/{id}/comments

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Data arguments :
  • id (required) - Job ID

Note : Possible values for “author” are “customer” or “translator”.

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13print(gengo.getTranslationJobComments(id=42))

Response

 1{
 2  "opstat": "ok",
 3  "response": {
 4    "thread": [
 5      {
 6        "body": "....",
 7        "author": "translator",
 8        "ctime": 1266322028
 9      },
10      {
11        "body": "....",
12        "author": "customer",
13        "ctime": 1266324432
14      }
15    ]
16  }
17}

Comment (POST)

Summary :

Submits a new comment to the job’s comment thread.

URL :

http://api.gengo.com/v2/translate/job/{id}/comment

Authentication :

Required

Parameters :
  • api_key (required) - Your API key

  • api_sig (required) - Your API signature

  • ts (required) - Current Unix epoch time as an integer

Data arguments :
  • id (required) - Job ID

  • body (required) - The comment body

Example call

 1#!/usr/bin/python
 2# -*- coding: utf-8 -*-
 3
 4from gengo import Gengo
 5
 6
 7gengo = Gengo(
 8    public_key='your_public_key',
 9    private_key='your_private_key',
10    sandbox=False,
11    debug=False)
12
13gengo.postTranslationJobComment(
14    id=42,
15    comment={
16        'body': 'I love lamp!'
17    }
18)

Response

1{
2  "opstat": "ok",
3  "response": {
4
5  }
6}