Comments (依頼へのコメント)

コメントの一覧取得

指定した依頼に対するコメント情報の一覧を取得することが出来ます。

Resource URL

GET /api/v1/questions/:question_id/comments

Example Response

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X GET https://biz.conyac.cc/api/v1/questions/6/comments?access_token=8c1525a501a5b10671b148003c65b1ed5c0598da5907f0a7855dc248faac8b76 
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "success": true,
  "message": "comments are found.",
  "page": 1,
  "per_page": 30,
  "total_pages": 1,
  "total_count": 6,
  "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
  },
  "question": {
    "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": 4,
    "status_text": "completed",
    "total_point": 32,
    "created_at": "2014-06-10T10:32:50.000+09:00",
    "updated_at": "2014-06-10T10:33:14.000+09:00",
    "custom_field": null,
    "description": "",
    "ended_at": "2014-06-10T10:33:14.000+09:00",
    "grab_expires_at": "2014-06-10T13:33:03.000+09:00",
    "translated_at": "2014-06-10T10:33:13.000+09:00",
    "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": false,
    "organization_id": 4,
    "file_type": "html_text",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  },
  "comments": [
    {
      "id": 1,
      "question_id": 6,
      "type_id": 1,
      "body": "Please give me the translation",
      "user_id": 107,
      "created_at": "2014-06-10T10:32:51.000+09:00",
      "updated_at": "2014-06-10T10:32:51.000+09:00",
      "user": {
        "id": 107,
        "login": "test10",
        "created_at": "2014-06-10T10:32:38.000+09:00",
        "updated_at": "2014-06-10T10:32:38.000+09:00",
        "locale": "en",
        "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
        "translator": false
      }
    },
    {
      "id": 2,
      "question_id": 6,
      "type_id": 1,
      "body": "Please give me the translation",
      "user_id": 107,
      "created_at": "2014-06-10T10:32:51.000+09:00",
      "updated_at": "2014-06-10T10:32:51.000+09:00",
      "user": {
        "id": 107,
        "login": "test10",
        "created_at": "2014-06-10T10:32:38.000+09:00",
        "updated_at": "2014-06-10T10:32:38.000+09:00",
        "locale": "en",
        "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
        "translator": false
      }
    },
    {
      "id": 4,
      "question_id": 6,
      "type_id": 13,
      "body": "",
      "user_id": 104,
      "created_at": "2014-06-10T10:32:57.000+09:00",
      "updated_at": "2014-06-10T10:32:57.000+09:00",
      "user": {
        "id": 104,
        "login": "testf14023639553124402",
        "created_at": "2014-06-10T10:32:35.000+09:00",
        "updated_at": "2014-06-10T10:32:55.000+09:00",
        "locale": "en",
        "picture_url": "https://secure.gravatar.com/avatar/36f7a7ff1977f2658c200910d1fd0ff2.png?d=identicon&r=PG&s=48",
        "translator": true,
        "native_language": null,
        "last_accessed_at": "2014-06-10T10:32:58.000+09:00",
        "online_status": 1,
        "online_status_text": "Online"
      }
    },
    {
      "id": 5,
      "question_id": 6,
      "type_id": 14,
      "body": "",
      "user_id": 104,
      "created_at": "2014-06-10T10:32:57.000+09:00",
      "updated_at": "2014-06-10T10:32:57.000+09:00",
      "user": {
        "id": 104,
        "login": "testf14023639553124402",
        "created_at": "2014-06-10T10:32:35.000+09:00",
        "updated_at": "2014-06-10T10:32:55.000+09:00",
        "locale": "en",
        "picture_url": "https://secure.gravatar.com/avatar/36f7a7ff1977f2658c200910d1fd0ff2.png?d=identicon&r=PG&s=48",
        "translator": true,
        "native_language": null,
        "last_accessed_at": "2014-06-10T10:32:58.000+09:00",
        "online_status": 1,
        "online_status_text": "Online"
      }
    },
    {
      "id": 6,
      "question_id": 6,
      "type_id": 13,
      "body": "",
      "user_id": 103,
      "created_at": "2014-06-10T10:33:03.000+09:00",
      "updated_at": "2014-06-10T10:33:03.000+09:00",
      "user": {
        "id": 103,
        "login": "testf1402363954988962",
        "created_at": "2014-06-10T10:32:34.000+09:00",
        "updated_at": "2014-06-10T10:33:01.000+09:00",
        "locale": "en",
        "picture_url": "https://secure.gravatar.com/avatar/df2bda484e262bf98324faeb77381a51.png?d=identicon&r=PG&s=48",
        "translator": true,
        "native_language": null,
        "last_accessed_at": "2014-06-10T10:33:15.000+09:00",
        "online_status": 1,
        "online_status_text": "Online"
      }
    },
    {
      "id": 7,
      "question_id": 6,
      "type_id": 10,
      "body": "",
      "user_id": 103,
      "created_at": "2014-06-10T10:33:13.000+09:00",
      "updated_at": "2014-06-10T10:33:13.000+09:00",
      "user": {
        "id": 103,
        "login": "testf1402363954988962",
        "created_at": "2014-06-10T10:32:34.000+09:00",
        "updated_at": "2014-06-10T10:33:01.000+09:00",
        "locale": "en",
        "picture_url": "https://secure.gravatar.com/avatar/df2bda484e262bf98324faeb77381a51.png?d=identicon&r=PG&s=48",
        "translator": true,
        "native_language": null,
        "last_accessed_at": "2014-06-10T10:33:15.000+09:00",
        "online_status": 1,
        "online_status_text": "Online"
      }
    }
  ]
}

コメントの取得

指定した依頼に対する特定のコメント情報を取得することが出来ます。

Resource URL

GET /api/v1/questions/:question_id/comments/:id

Example Response

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X GET https://biz.conyac.cc/api/v1/questions/6/comments/3?access_token=8c1525a501a5b10671b148003c65b1ed5c0598da5907f0a7855dc248faac8b76 
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "success": true,
  "message": "the comment is found.",
  "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
  },
  "question": {
    "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",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  },
  "comment": {
    "id": 3,
    "question_id": 6,
    "type_id": 1,
    "body": "updated comment",
    "user_id": 107,
    "created_at": "2014-06-10T10:32:51.000+09:00",
    "updated_at": "2014-06-10T10:32:51.000+09:00",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    }
  }
}

コメントの新規作成

指定した依頼に対してコメントを投稿することが出来ます。

Resource URL

POST /api/v1/:question_id/comments

Example Response

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X POST https://biz.conyac.cc/api/v1/questions/6/comments -d '{"body": "thank you"}'
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Location: https://biz.conyac.cc/api/v1/questions/6/comments/3
{
  "success": true,
  "message": "the comment is found.",
  "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
  },
  "question": {
    "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",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  },
  "comment": {
    "id": 3,
    "question_id": 6,
    "type_id": 1,
    "body": "Please give me the translation",
    "user_id": 107,
    "created_at": "2014-06-10T10:32:51.810+09:00",
    "updated_at": "2014-06-10T10:32:51.810+09:00",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    }
  }
}

コメントの更新

指定したコメントを更新することが出来ます。

Resource URL

PUT /api/v1/questions/:question_id/comments/:id

Example Response

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X PUT https://biz.conyac.cc/api/v1/questions/6/comments/3 -d '{"body": "thank you"}'
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "success": true,
  "message": "the comment is found.",
  "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
  },
  "question": {
    "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",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  },
  "comment": {
    "id": 3,
    "question_id": 6,
    "type_id": 1,
    "body": "updated comment",
    "user_id": 107,
    "created_at": "2014-06-10T10:32:51.000+09:00",
    "updated_at": "2014-06-10T10:32:51.851+09:00",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    }
  }
}

コメントの削除

指定したコメントを削除することが出来ます。

Resource URL

DELETE /api/v1/questions/:question_id/comments/:id

Example Response

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X DELETE https://biz.conyac.cc/api/v1/questions/6/comments/3?access_token=8c1525a501a5b10671b148003c65b1ed5c0598da5907f0a7855dc248faac8b76 
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "success": true,
  "message": "the comment is found.",
  "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
  },
  "question": {
    "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",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  },
  "comment": {
    "id": 3,
    "question_id": 6,
    "type_id": 1,
    "body": "updated comment",
    "user_id": 107,
    "created_at": "2014-06-10T10:32:51.000+09:00",
    "updated_at": "2014-06-10T10:32:51.000+09:00",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:32:38.000+09:00",
      "updated_at": "2014-06-10T10:32:38.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    }
  }
}