Account methods¶
This describes the endpoints that deal with Account information on Gengo API.
Stats (GET)¶
- Summary :
Retrieves account stats, such as orders made.
- URL :
http://api.gengo.com/v2/account/stats
- Authentication :
Required
- Parameters :
api_key
(required) - Your API keyapi_sig
(required) - Your API signaturets
(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.getAccountStats())
Response
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)¶
- Summary :
Retrieves account information, such as email.
- URL :
http://api.gengo.com/v2/account/me
- Authentication :
Required
- Parameters :
api_key
(required) - Your API keyapi_sig
(required) - Your API signaturets
(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.getAccountMe())
Response
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)¶
- Summary :
Retrieves account balance in credits.
- URL :
http://api.gengo.com/v2/account/balance
- Authentication :
Required
- Parameters :
api_key
(required) - Your API keyapi_sig
(required) - Your API signaturets
(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.getAccountBalance())
Response
1{
2 "opstat": "ok",
3 "response": {
4 "credits": 25.32,
5 "currency": "USD"
6 }
7}
Preferred translators (GET)¶
- Summary :
Retrieves preferred translators set by user.
- URL :
http://api.gengo.com/v2/account/preferred_translators
- Authentication :
Required
- Parameters :
api_key
(required) - Your API keyapi_sig
(required) - Your API signaturets
(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.getPreferredTranslators())
Response
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}