プロジェクトを新規に作成することが出来ます。
プロジェクトとは翻訳依頼注文の情報を格納するオブジェクトのことを指します。
詳しくはこちらから確認することが出来ます。
POST /api/v1/projects
string
: 文字依頼text_html
: 文字依頼のHTMLfile
: ファイル依頼{{{}}}
で囲まれた文字は翻訳しない, 0
もしくは 1
type=file
の場合のみ使用0
もしくは 1
0
or 1
[3,5,7]
{
"language_id": "ja",
"translated_language_id": "en",
"questions": [
{
"description": "intoroduction etc..",
"title": "Test Request",
"custom_field": "test1",
"body": null,
"type": "file",
"source_id": 1
},
{
"body": "body2<hoge>ddd</hoge>",
"type": "text_html"
}
],
"access_token": "8c1525a501a5b10671b148003c65b1ed5c0598da5907f0a7855dc248faac8b76"
}
$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X POST https://biz.conyac.cc/api/v1/projects -d '{"language_id":"ja","translated_language_id":"en","questions":[{"description":"intoroduction etc..","title":"Test Request","custom_field":"test1","body":null,"type":"file","source_id":1},{"body":"body2ddd ","type":"text_html"}],"access_token":"8c1525a501a5b10671b148003c65b1ed5c0598da5907f0a7855dc248faac8b76"}' HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 Location: https://biz.conyac.cc/api/v1/projects/3
{
"success": true,
"message": "the project is found.",
"project": {
"id": 3,
"organization_id": 4,
"user_id": 107,
"point": 7088,
"created_at": "2014-06-10T10:32:50.756+09:00",
"updated_at": "2014-06-10T10:32:50.756+09:00",
"language_id": "ja",
"translated_language_id": "en",
"individual": false,
"url": "https://biz.conyac.cc/api/v1/projects/3",
"html_url": "https://conyac.cc/b/projects/3",
"question_count": 2,
"organization": {
"id": 4,
"name": "test10",
"plan_id": 1,
"user_id": 107,
"default": 1,
"description": null,
"created_at": "2014-06-10T10:32:38.000+09:00",
"updated_at": "2014-06-10T10:32:50.767+09:00",
"url": "https://biz.conyac.cc/api/v1/organizations/4",
"html_url": "https://conyac.cc/b/organizations/4",
"point": 78986,
"available_point": 78986
},
"questions": [
{
"id": 5,
"project_id": 3,
"question_source_id": 1,
"user_id": 107,
"title": "Test Request",
"letter_count": 1764,
"language_id": "ja",
"translated_language_id": "en",
"status": 0,
"status_text": "pending",
"total_point": 7056,
"created_at": "2014-06-10T10:32:50.757+09:00",
"updated_at": "2014-06-10T10:32:50.757+09:00",
"custom_field": "test1",
"description": "intoroduction etc..",
"ended_at": null,
"grab_expires_at": null,
"translated_at": null,
"individual": false,
"double_check": false,
"escape_text": false,
"url": "https://biz.conyac.cc/api/v1/questions/5",
"html_url": "https://conyac.cc/b/projects/3/questions/5",
"cancelable": true,
"organization_id": 4,
"file_type": "pptx"
},
{
"id": 6,
"project_id": 3,
"question_source_id": 7,
"user_id": 107,
"title": "body2<hoge>ddd</hoge>",
"letter_count": 8,
"language_id": "ja",
"translated_language_id": "en",
"status": 0,
"status_text": "pending",
"total_point": 32,
"created_at": "2014-06-10T10:32:50.761+09:00",
"updated_at": "2014-06-10T10:32:50.761+09:00",
"custom_field": null,
"description": "",
"ended_at": null,
"grab_expires_at": null,
"translated_at": null,
"individual": false,
"double_check": false,
"escape_text": false,
"url": "https://biz.conyac.cc/api/v1/questions/6",
"html_url": "https://conyac.cc/b/projects/3/questions/6",
"cancelable": true,
"organization_id": 4,
"file_type": "html_text"
}
],
"language": {
"id": "ja",
"localized_name": "Japanese"
},
"translated_language": {
"id": "en",
"localized_name": "English"
}
}
}
指定したプロジェクトの内容を取得することが出来ます。
GET /api/v1/projects/:project_id
$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X GET https://biz.conyac.cc/api/v1/projects/3?access_token=8c1525a501a5b10671b148003c65b1ed5c0598da5907f0a7855dc248faac8b76 HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{
"success": true,
"message": "the project is found.",
"project": {
"id": 3,
"organization_id": 4,
"user_id": 107,
"point": 7088,
"created_at": "2014-06-10T10:32:50.000+09:00",
"updated_at": "2014-06-10T10:32:50.000+09:00",
"language_id": "ja",
"translated_language_id": "en",
"individual": false,
"url": "https://biz.conyac.cc/api/v1/projects/3",
"html_url": "https://conyac.cc/b/projects/3",
"question_count": 2,
"organization": {
"id": 4,
"name": "test10",
"plan_id": 1,
"user_id": 107,
"default": 1,
"description": null,
"created_at": "2014-06-10T10:32:38.000+09:00",
"updated_at": "2014-06-10T10:32:50.000+09:00",
"url": "https://biz.conyac.cc/api/v1/organizations/4",
"html_url": "https://conyac.cc/b/organizations/4",
"point": 78986,
"available_point": 78986
},
"questions": [
{
"id": 5,
"project_id": 3,
"question_source_id": 1,
"user_id": 107,
"title": "Test Request",
"letter_count": 1764,
"language_id": "ja",
"translated_language_id": "en",
"status": 0,
"status_text": "pending",
"total_point": 7056,
"created_at": "2014-06-10T10:32:50.000+09:00",
"updated_at": "2014-06-10T10:32:50.000+09:00",
"custom_field": "test1",
"description": "intoroduction etc..",
"ended_at": null,
"grab_expires_at": null,
"translated_at": null,
"individual": false,
"double_check": false,
"escape_text": false,
"url": "https://biz.conyac.cc/api/v1/questions/5",
"html_url": "https://conyac.cc/b/projects/3/questions/5",
"cancelable": true,
"organization_id": 4,
"file_type": "pptx"
},
{
"id": 6,
"project_id": 3,
"question_source_id": 7,
"user_id": 107,
"title": "body2<hoge>ddd</hoge>",
"letter_count": 8,
"language_id": "ja",
"translated_language_id": "en",
"status": 0,
"status_text": "pending",
"total_point": 32,
"created_at": "2014-06-10T10:32:50.000+09:00",
"updated_at": "2014-06-10T10:32:50.000+09:00",
"custom_field": null,
"description": "",
"ended_at": null,
"grab_expires_at": null,
"translated_at": null,
"individual": false,
"double_check": false,
"escape_text": false,
"url": "https://biz.conyac.cc/api/v1/questions/6",
"html_url": "https://conyac.cc/b/projects/3/questions/6",
"cancelable": true,
"organization_id": 4,
"file_type": "html_text"
}
],
"language": {
"id": "ja",
"localized_name": "Japanese"
},
"translated_language": {
"id": "en",
"localized_name": "English"
}
}
}
Project登録時のvalidationを行い結果を返します。登録はされません。
POST /api/v1/projects/check
$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X POST https://biz.conyac.cc/api/v1/projects/check -d '{"language_id":"ja","translated_language_id":"en","questions":[{"description":"intoroduction etc..","title":"Test Request","custom_field":"test1","body":null,"type":"file","source_id":1},{"body":"body2ddd ","type":"text_html"}],"access_token":"8c1525a501a5b10671b148003c65b1ed5c0598da5907f0a7855dc248faac8b76"}' HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{
"success": true,
"message": "the project is checked.",
"project": {
"organization_id": 4,
"user_id": 107,
"point": 7088,
"language_id": "ja",
"translated_language_id": "en",
"individual": false,
"question_count": 0,
"organization": {
"id": 4,
"name": "test10",
"plan_id": 1,
"user_id": 107,
"default": 1,
"description": null,
"created_at": "2014-06-10T10:32:38.000+09:00",
"updated_at": "2014-06-10T10:32:49.000+09:00",
"url": "https://biz.conyac.cc/api/v1/organizations/4",
"html_url": "https://conyac.cc/b/organizations/4",
"point": 86074,
"available_point": 86074
},
"questions": [
{
"user_id": 107,
"title": "Test Request",
"letter_count": 1764,
"language_id": "ja",
"translated_language_id": "en",
"total_point": 7056,
"custom_field": "test1",
"description": "intoroduction etc..",
"individual": false,
"escape_text": false,
"organization_id": 4
},
{
"user_id": 107,
"title": "body2<hoge>ddd</hoge>",
"letter_count": 8,
"language_id": "ja",
"translated_language_id": "en",
"total_point": 32,
"custom_field": null,
"description": "",
"individual": false,
"escape_text": false,
"organization_id": 4
}
],
"language": {
"id": "ja",
"localized_name": "Japanese"
},
"translated_language": {
"id": "en",
"localized_name": "English"
}
}
}