Projects (プロジェクト)

プロジェクトの新規作成

プロジェクトを新規に作成することが出来ます。

プロジェクトとは翻訳依頼注文の情報を格納するオブジェクトのことを指します。

詳しくはこちらから確認することが出来ます。

Resource URL

POST /api/v1/projects

Parameters

  • organization_id (必須)
    依頼にひもづくグループID
  • language_id (必須)
    翻訳元言語
  • translated_language_id (必須)
    翻訳先言語
Projectオブジェクトの属性
  • type
    • string: 文字依頼
    • text_html: 文字依頼のHTML
    • file: ファイル依頼
  • escape_text
    {{{}}}で囲まれた文字は翻訳しない, 0 もしくは 1
  • source_id
    翻訳対象のファイルID。type=fileの場合のみ使用
  • body
    依頼本文
  • title
    依頼のタイトル。未入力の場合は、翻訳テキストのタイトルの先頭、ファイルの場合ファイル名を使用。
  • description
    翻訳に対する補足説明。翻訳の仕方や要望など
  • double_check
    ダブルチェックオプションを使用するかどうか. 0 もしくは 1
  • custom_field
    自由に設定できるカスタムフィールド. 最大255の文字列
  • individual
    プレミアムオプションを使用するかどうか 0 or 1
  • translator_list_ids
    プレミアムオプションを使用する場合の翻訳者リストID e.g. [3,5,7]

送信するJSON形式のプロジェクト情報

{
  "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"
}

Example Response

$ 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"
    }
  }
}

プロジェクトの内容取得

指定したプロジェクトの内容を取得することが出来ます。

Resource URL

GET /api/v1/projects/:project_id

Example Response

$ 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を行い結果を返します。登録はされません。

Resource URL

POST /api/v1/projects/check

Example Response

$ 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"
    }
  }
}