Glossary methods¶
ここでは、各種用語集をGengo API上で扱うエンドポイントについてご説明しています。
Glossaries (GET)¶
- 概要 :
 認証されたユーザーに属する各種用語集のリストを取得します。
- URL :
 http://api.gengo.com/v2/translate/glossary
- 認証 :
 必須
- パラメータ :
 api_key(必須) - お客様の API keyapi_sig(必須) - お客様の API signaturets(必須) - 現在のUNIX時間のInteger (整数型)
呼び出し例
 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.getGlossaryList())
返り値
 1{
 2  "opstat": "ok",
 3  "response": [
 4    {
 5      "customer_user_id": 50110,
 6      "source_language_id": 8,
 7      "target_languages": [
 8        [
 9          14,
10          "ja"
11        ]
12      ],
13      "id": 115,
14      "is_public": false,
15      "unit_count": 2,
16      "description": null,
17      "source_language_code": "en-US",
18      "ctime": "2012-07-19 02:57:10.526565",
19      "title": "1342666627_50110_en_ja_glossary.csv",
20      "status": 1
21    }
22  ]
23}
Glossary (GET)¶
- 概要 :
 特定の用語集をIDから取得します。
- URL :
 http://api.gengo.com/v2/translate/glossary/{glossary_id}
- 認証 :
 必須
- パラメータ :
 api_key(必須) - お客様の API keyapi_sig(必須) - お客様の API signaturets(必須) - 現在のUNIX時間のInteger (整数型)
呼び出し例
 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.getGlossary(id=115))
返り値
 1{
 2  "opstat": "ok",
 3  "response": {
 4    "customer_user_id": 50110,
 5    "source_language_id": 8,
 6    "target_languages": [
 7      [
 8        14,
 9        "ja"
10      ]
11    ],
12    "id": 115,
13    "is_public": false,
14    "unit_count": 2,
15    "description": null,
16    "source_language_code": "en-US",
17    "ctime": "2012-07-19 02:57:10.526565",
18    "title": "1342666627_50110_en_ja_glossary.csv",
19    "status": 1
20  }
21}