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#!/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.getTranslationOrderJobs(id=232))

Response

 1{
 2  "opstat": "ok",
 3  "response": {
 4    "order": {
 5      "jobs_queued": 0,
 6      "jobs_reviewable": [
 7
 8      ],
 9      "jobs_available": [
10        "243646",
11        "243647",
12        "243645"
13      ],
14      "jobs_pending": [
15
16      ],
17      "jobs_approved": [
18
19      ],
20      "jobs_revising": [
21
22      ],
23      "jobs_cancelled": [
24
25      ],
26      "jobs_held": [
27
28      ],
29      "order_id": "232",
30      "total_credits": "0.30",
31      "total_units": 6,
32      "total_jobs": "3",
33      "currency": "USD"
34    }
35  }
36}

Order (DELETE)

Summary :

Cancels all available jobs in an order. Please keep in mind that this will not cancel jobs that are in another status (e.g. pending, reviewable, etc.).

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#!/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.deleteTranslationOrder(id=42)

Response

 1{
 2  "opstat": "ok",
 3  "response": {
 4    "order": {
 5      "jobs_queued": 0,
 6      "jobs_reviewable": [
 7          "243648"
 8      ],
 9      "jobs_available": [
10
11      ],
12      "jobs_cancelled": [
13          "243646",
14          "243647",
15          "243645"
16      ],
17      "jobs_pending": [
18
19      ],
20      "jobs_approved": [
21
22      ],
23      "order_id": "232",
24      "total_credits": "0.80",
25      "total_units": 10,
26      "total_jobs": "4",
27      "jobs_revising": [
28
29      ],
30      "currency": "USD"
31    }
32  }
33}

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#!/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.getOrderComments(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 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#!/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.postOrderComment(
14    id=42,
15    comment={
16        'body': 'I love lamp!'
17    }
18)

Response

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