Order methods

This describes the endpoints that deal with Order on the Gengo API.

Order (GET)

Summary :
Retrieves a group of jobs that were previously submitted together by their order id.
URL :
http://api.gengo.com/v2/translate/order/{order_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
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/usr/bin/python
# -*- coding: utf-8 -*-

from gengo import Gengo


gengo = Gengo(
    public_key='your_public_key',
    private_key='your_private_key',
    sandbox=False,
    debug=False)

print(gengo.getTranslationOrderJobs(id=232))

Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  "opstat": "ok",
  "response": {
    "order": {
      "jobs_queued": 0,
      "jobs_reviewable": [

      ],
      "jobs_available": [
        "243646",
        "243647",
        "243645"
      ],
      "jobs_pending": [

      ],
      "jobs_approved": [

      ],
      "order_id": "232",
      "total_credits": "0.30",
      "total_units": 6,
      "total_jobs": "3",
      "jobs_revising": [

      ],
      "currency": "USD"
    }
  }
}

Order (DELETE)

Summary :
Cancels all jobs in an order. Please keep in mind, this endpoint works when all jobs in an order are in available state. This also cancels the order itself.
URL :
http://api.gengo.com/v2/translate/order/{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
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/usr/bin/python
# -*- coding: utf-8 -*-

from gengo import Gengo


gengo = Gengo(
    public_key='your_public_key',
    private_key='your_private_key',
    sandbox=False,
    debug=False)

gengo.deleteTranslationOrder(id=42)

Response

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

  }
}

Comments (GET)

Summary :
Retrieves the comment thread for an order.
URL :
http://api.gengo.com/v2/translate/order/{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) - Order ID

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

Example call

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/usr/bin/python
# -*- coding: utf-8 -*-

from gengo import Gengo


gengo = Gengo(
    public_key='your_public_key',
    private_key='your_private_key',
    sandbox=False,
    debug=False)

print(gengo.getTranslationOrderComments(id=42))

Response

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

Comment (POST)

Summary :
Submits a new comment to the order’s comment thread.
URL :
http://api.gengo.com/v2/translate/order/{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) - Order ID
  • body (required) - The comment body

Example call

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python
# -*- coding: utf-8 -*-

from gengo import Gengo


gengo = Gengo(
    public_key='your_public_key',
    private_key='your_private_key',
    sandbox=False,
    debug=False)

gengo.postOrderComment(
    id=42,
    comment={
        'body': 'I love lamp!'
    }
)

Response

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

  }
}