Simple Questions (Requests)

Creating a simple question

Parameters

  • organization_id
    Organization ID
  • language_id
    ID of the source language
  • translated_language_id
    ID of the target language
  • description
    Additional information (or instructions) for translators regarding the translation request
  • published_scope
    Determines if the request is private or not
    • 0: Public
    • 2: Private
  • escape_text
    Text surrounded with {{{}}} will not be translated. 0 or 1
  • text_format
    0: Text (default)
    1: HTML
  • custom_field
    String. max lenght: 255
question_bodies
  • body
    The body (contents) of the request

An example of the Project information’s JSON form

{
  "custom_field": "test1",
  "language_id": "ja",
  "translated_language_id": "en",
  "question_bodies": [
    {
      "body": "hoge"
    },
    {
      "body": "hoge<a href='/'>{{{{hoge}}}</a>"
    }
  ],
  "text_format": 1,
  "escape_text": 1,
  "access_token": "48c8a5caa45b12f706f297626a589096b3f01287e73b17d1a6201063552b30c6",
  "published_scope": 2,
  "native": 0
}

Response

question
Simple Question Object
$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X POST https://biz.conyac.cc/api/v1/simple/questions -d '{"custom_field":"test1","language_id":"ja","translated_language_id":"en","question_bodies":[{"body":"hoge"},{"body":"hoge{{{{hoge}}}"}],"text_format":1,"escape_text":1,"access_token":"48c8a5caa45b12f706f297626a589096b3f01287e73b17d1a6201063552b30c6","published_scope":2,"native":0}'
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Location: https://biz.conyac.cc/api/v1/simple/questions/105
{
  "success": true,
  "message": "The question is found.",
  "question": {
    "id": 105,
    "description": null,
    "user_id": 107,
    "parent_id": null,
    "type_id": 1,
    "published_scope": 2,
    "expires_at": "2014-06-11T10:32:55.221+09:00",
    "views_count": 0,
    "letter_count": 12,
    "language_id": "ja",
    "translated_language_id": "en",
    "status": 0,
    "status_text": "Pending",
    "published_at": "2014-06-10T10:32:55.221+09:00",
    "translated_at": null,
    "created_at": "2014-06-10T10:31:55.225+09:00",
    "updated_at": "2014-06-10T10:31:55.225+09:00",
    "tag_text": null,
    "draft_question_id": null,
    "first_body": "hoge",
    "native": false,
    "translations_count": 0,
    "working_translations_count": 0,
    "individual": false,
    "progress_rate": 0,
    "organization_id": 4,
    "escape_text": true,
    "text_format": 1,
    "custom_field": "test1",
    "cancelable": true,
    "listing?": false,
    "total_point": 800,
    "question_bodies": [
      {
        "id": 1029341674,
        "question_id": 105,
        "display_order": 1,
        "body": "hoge",
        "translated_at": null,
        "letter_count": 4,
        "translations_count": 0,
        "created_at": "2014-06-10T10:31:55.227+09:00",
        "updated_at": "2014-06-10T10:31:55.227+09:00",
        "translations": [

        ]
      },
      {
        "id": 1029341675,
        "question_id": 105,
        "display_order": 2,
        "body": "hoge<a href='/'>{{{{hoge}}}</a>",
        "translated_at": null,
        "letter_count": 8,
        "translations_count": 0,
        "created_at": "2014-06-10T10:31:55.230+09:00",
        "updated_at": "2014-06-10T10:31:55.230+09:00",
        "translations": [

        ]
      }
    ],
    "url": "https://biz.conyac.cc/api/v1/simple/questions/105",
    "html_url": "https://conyac.cc/questions/105",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:49.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "organization": {
      "id": 4,
      "name": "test10",
      "plan_id": 1,
      "user_id": 107,
      "default": 1,
      "description": null,
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:55.255+09:00",
      "url": "https://biz.conyac.cc/api/v1/organizations/4",
      "html_url": "https://conyac.cc/b/organizations/4",
      "point": 119450,
      "available_point": 119450
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  }
}

Validation check API

POST /api/v1/simple/questions/check

Response

Validation ok

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X POST https://biz.conyac.cc/api/v1/simple/questions/check -d '{"custom_field":"test1","language_id":"ja","translated_language_id":"en","question_bodies":[{"body":"hoge"},{"body":"hoge{{{{hoge}}}"}],"text_format":1,"escape_text":1,"access_token":"48c8a5caa45b12f706f297626a589096b3f01287e73b17d1a6201063552b30c6","published_scope":2,"native":0}'
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "success": true,
  "message": "The question is checked.",
  "question": {
    "id": null,
    "description": null,
    "user_id": 107,
    "parent_id": null,
    "type_id": 1,
    "published_scope": 2,
    "expires_at": "2014-06-11T10:32:55.192+09:00",
    "views_count": 0,
    "letter_count": 12,
    "language_id": "ja",
    "translated_language_id": "en",
    "status": 0,
    "status_text": "Pending",
    "published_at": "2014-06-10T10:32:55.192+09:00",
    "translated_at": null,
    "created_at": null,
    "updated_at": null,
    "tag_text": null,
    "draft_question_id": null,
    "first_body": "hoge",
    "native": false,
    "translations_count": 0,
    "working_translations_count": 0,
    "individual": false,
    "progress_rate": 0,
    "organization_id": 4,
    "escape_text": true,
    "text_format": 1,
    "custom_field": "test1",
    "cancelable": true,
    "listing?": false,
    "total_point": 800,
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:49.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "organization": {
      "id": 4,
      "name": "test10",
      "plan_id": 1,
      "user_id": 107,
      "default": 1,
      "description": null,
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:55.000+09:00",
      "url": "https://biz.conyac.cc/api/v1/organizations/4",
      "html_url": "https://conyac.cc/b/organizations/4",
      "point": 120250,
      "available_point": 120250
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  }
}

Validation fail

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X POST https://biz.conyac.cc/api/v1/simple/questions/check 
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
{
  "message": "Validation Fail",
  "error_code": 201,
  "success": false,
  "errors": {
    "language": "can't be blank",
    "translated_language": "can't be blank",
    "question_bodies": "can't be blank",
    "translated_language_id": "is invalid"
  }
}

Request Content Confirmation

GET /api/v1/simple/questions/:question_id

Response

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X GET https://biz.conyac.cc/api/v1/simple/questions/107?access_token=48c8a5caa45b12f706f297626a589096b3f01287e73b17d1a6201063552b30c6 
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "success": true,
  "message": "The question is found.",
  "question": {
    "id": 107,
    "description": null,
    "user_id": 107,
    "parent_id": null,
    "type_id": 1,
    "published_scope": 2,
    "expires_at": "2014-06-11T10:32:55.000+09:00",
    "views_count": 4,
    "letter_count": 12,
    "language_id": "ja",
    "translated_language_id": "en",
    "status": 4,
    "status_text": "Completed",
    "published_at": "2014-06-10T10:32:55.000+09:00",
    "translated_at": "2014-06-10T10:32:23.000+09:00",
    "created_at": "2014-06-10T10:31:55.000+09:00",
    "updated_at": "2014-06-10T10:32:23.000+09:00",
    "tag_text": null,
    "draft_question_id": null,
    "first_body": "hoge",
    "native": false,
    "translations_count": 4,
    "working_translations_count": 0,
    "individual": false,
    "progress_rate": 100,
    "organization_id": 4,
    "escape_text": true,
    "text_format": 1,
    "custom_field": "test1",
    "cancelable": false,
    "listing?": false,
    "total_point": 800,
    "question_bodies": [
      {
        "id": 1029341678,
        "question_id": 107,
        "display_order": 1,
        "body": "hoge",
        "translated_at": "2014-06-10T10:32:17.000+09:00",
        "letter_count": 4,
        "translations_count": 2,
        "created_at": "2014-06-10T10:31:55.000+09:00",
        "updated_at": "2014-06-10T10:32:24.000+09:00",
        "translations": [
          {
            "id": 1824432906,
            "question_id": 107,
            "question_body_id": 1029341678,
            "body": "hoge hoge hoge hoge hoge hoge hoge hoge hoge hoge ",
            "created_at": "2014-06-10T10:32:01.000+09:00",
            "updated_at": "2014-06-10T10:32:24.000+09:00",
            "user_id": 103,
            "trainee": false,
            "posted_at": "2014-06-10T10:32:03.000+09:00",
            "comments_count": 0
          },
          {
            "id": 1824432908,
            "question_id": 107,
            "question_body_id": 1029341678,
            "body": "hoge hoge hoge hoge hoge hoge hoge hoge hoge hoge ",
            "created_at": "2014-06-10T10:32:14.000+09:00",
            "updated_at": "2014-06-10T10:32:24.000+09:00",
            "user_id": 104,
            "trainee": false,
            "posted_at": "2014-06-10T10:32:17.000+09:00",
            "comments_count": 0
          }
        ]
      },
      {
        "id": 1029341679,
        "question_id": 107,
        "display_order": 2,
        "body": "hoge<a href='/'>{{{{hoge}}}</a>",
        "translated_at": "2014-06-10T10:32:23.000+09:00",
        "letter_count": 8,
        "translations_count": 2,
        "created_at": "2014-06-10T10:31:55.000+09:00",
        "updated_at": "2014-06-10T10:32:24.000+09:00",
        "translations": [
          {
            "id": 1824432907,
            "question_id": 107,
            "question_body_id": 1029341679,
            "body": "hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>",
            "created_at": "2014-06-10T10:32:06.000+09:00",
            "updated_at": "2014-06-10T10:32:24.000+09:00",
            "user_id": 103,
            "trainee": false,
            "posted_at": "2014-06-10T10:32:09.000+09:00",
            "comments_count": 0
          },
          {
            "id": 1824432909,
            "question_id": 107,
            "question_body_id": 1029341679,
            "body": "hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>hoge <a href='/'> { {{{hoge}}} </a>",
            "created_at": "2014-06-10T10:32:19.000+09:00",
            "updated_at": "2014-06-10T10:32:24.000+09:00",
            "user_id": 104,
            "trainee": false,
            "posted_at": "2014-06-10T10:32:23.000+09:00",
            "comments_count": 0
          }
        ]
      }
    ],
    "url": "https://biz.conyac.cc/api/v1/simple/questions/107",
    "html_url": "https://conyac.cc/questions/107",
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:49.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "organization": {
      "id": 4,
      "name": "test10",
      "plan_id": 1,
      "user_id": 107,
      "default": 1,
      "description": null,
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:55.000+09:00",
      "url": "https://biz.conyac.cc/api/v1/organizations/4",
      "html_url": "https://conyac.cc/b/organizations/4",
      "point": 119450,
      "available_point": 119450
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  }
}

Request Cancellation

PUT /api/v1/simple/questions/:question_id/cancel

Response

$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X PUT https://biz.conyac.cc/api/v1/simple/questions/105/cancel 
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Location: https://biz.conyac.cc/b/organizations/4/personal/questions/drafts/1
{
  "success": true,
  "message": "The question was canceled.",
  "question": {
    "id": null,
    "description": null,
    "user_id": 107,
    "parent_id": null,
    "type_id": 1,
    "published_scope": 0,
    "expires_at": null,
    "views_count": 0,
    "letter_count": 0,
    "language_id": "ja",
    "translated_language_id": "en",
    "status": 0,
    "status_text": "Pending",
    "published_at": null,
    "translated_at": null,
    "created_at": null,
    "updated_at": null,
    "tag_text": null,
    "draft_question_id": 1,
    "first_body": "hoge",
    "native": false,
    "translations_count": 0,
    "working_translations_count": 0,
    "individual": false,
    "progress_rate": 0,
    "organization_id": 4,
    "escape_text": false,
    "text_format": 0,
    "custom_field": null,
    "cancelable": true,
    "listing?": false,
    "total_point": 0,
    "question_bodies": [
      {
        "id": null,
        "question_id": null,
        "display_order": 1,
        "body": "hoge",
        "translated_at": null,
        "letter_count": 0,
        "translations_count": 0,
        "created_at": null,
        "updated_at": null
      },
      {
        "id": null,
        "question_id": null,
        "display_order": 2,
        "body": "hoge<a href='/'>{{{{hoge}}}</a>",
        "translated_at": null,
        "letter_count": 0,
        "translations_count": 0,
        "created_at": null,
        "updated_at": null
      }
    ],
    "user": {
      "id": 107,
      "login": "test10",
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:49.000+09:00",
      "locale": "en",
      "picture_url": "https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.png?d=identicon&r=PG&s=48",
      "translator": false
    },
    "organization": {
      "id": 4,
      "name": "test10",
      "plan_id": 1,
      "user_id": 107,
      "default": 1,
      "description": null,
      "created_at": "2014-06-10T10:31:49.000+09:00",
      "updated_at": "2014-06-10T10:31:55.000+09:00",
      "url": "https://biz.conyac.cc/api/v1/organizations/4",
      "html_url": "https://conyac.cc/b/organizations/4",
      "point": 120250,
      "available_point": 120250
    },
    "language": {
      "id": "ja",
      "localized_name": "Japanese"
    },
    "translated_language": {
      "id": "en",
      "localized_name": "English"
    }
  }
}