Account methods¶
ここでは、アカウント情報をGengo API上での取り扱うエンドポイントをご説明しています。
Stats (GET)¶
- 概要 :
- アカウントの履歴 (ご注文履歴など) を取得します。 
- URL :
- http://api.gengo.com/v2/account/stats 
- 認証 :
- 必須 
- パラメータ :
- api_key(必須) - お客様の API key
- api_sig(必須) - お客様の API signature
- ts(必須) - 現在の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.getAccountStats())
返り値
 1{
 2  "opstat": "ok",
 3  "response": {
 4    "credits_spent": 1023.31,
 5    "user_since": 1234089500,
 6    "currency": "USD",
 7    "billing_type": "Pre-pay",
 8    "customer_type": "Retail"
 9  }
10}
Me (GET)¶
- 概要 :
- アカウント情報 (メールアドレスなど) を取得します。 
- URL :
- http://api.gengo.com/v2/account/me 
- 認証 :
- 必須 
- パラメータ :
- api_key(必須) - お客様の API key
- api_sig(必須) - お客様の API signature
- ts(必須) - 現在の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.getAccountMe())
返り値
1{
2  "opstat": "ok",
3  "response": {
4	  "email": "john@gengo.com",
5	  "full_name": "John Doe",
6	  "display_name": "johnny",
7	  "language_code": "en"
8  }
9}
Balance (GET)¶
- 概要 :
- アカウントのポイント残高を取得します。 
- URL :
- http://api.gengo.com/v2/account/balance 
- 認証 :
- 必須 
- パラメータ :
- api_key(必須) - お客様の API key
- api_sig(必須) - お客様の API signature
- ts(必須) - 現在の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.getAccountBalance())
返り値
1{
2  "opstat": "ok",
3  "response": {
4    "credits": 25.32,
5    "currency": "USD"
6  }
7}
Preferred translators (GET)¶
- 概要 :
- アカウントのお気に入り翻訳者情報を取得します。 
- URL :
- http://api.gengo.com/v2/account/preferred_translators 
- 認証 :
- 必須 
- パラメータ :
- api_key(必須) - お客様の API key
- api_sig(必須) - お客様の API signature
- ts(必須) - 現在の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.getPreferredTranslators())
返り値
 1{
 2  "opstat": "ok",
 3  "response": [
 4    {
 5      "translators": [
 6        {
 7          "last_login": 1375824155,
 8          "id": 8596
 9        },
10        {
11          "last_login": 1372822132,
12          "id": 24123
13        }
14      ],
15      "lc_tgt": "ja",
16      "lc_src": "en",
17      "tier": "standard"
18    },
19    {
20      "translators": [
21        {
22          "last_login": 1375825234,
23          "id": 14765
24        },
25        {
26          "last_login": 1372822132,
27          "id": 3627
28        }
29      ],
30      "lc_tgt": "en",
31      "lc_src": "ja",
32      "tier": "pro"
33    }
34  ]
35}