From 5e0313ab7e1c191828657ad124ed103d38d325d6 Mon Sep 17 00:00:00 2001 From: Victor Lam Date: Mon, 17 Feb 2014 15:55:18 +0800 Subject: [PATCH 1/3] fix link --- resources/import_task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/import_task.md b/resources/import_task.md index 8660dd0..e2bd01d 100644 --- a/resources/import_task.md +++ b/resources/import_task.md @@ -44,4 +44,4 @@ NONE ``` Remark: `status` can be either `completed`, `in-progress` or `failed`. -[Back to top](#file) +[Back to top](#import-task) From 1dcc37ffdd8c79a33c71230254d2f5fc184064b3 Mon Sep 17 00:00:00 2001 From: Victor Lam Date: Mon, 17 Feb 2014 17:09:02 +0800 Subject: [PATCH 2/3] - revise import tasks to able to handle tasks of phrase collections - create sample response for tasks of file and phrase collections --- reference/import_tasks_response_samples.md | 105 +++++++++++++++++++++ resources/import_task.md | 89 ++++++++++++++++- 2 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 reference/import_tasks_response_samples.md diff --git a/reference/import_tasks_response_samples.md b/reference/import_tasks_response_samples.md new file mode 100644 index 0000000..1c5154b --- /dev/null +++ b/reference/import_tasks_response_samples.md @@ -0,0 +1,105 @@ +## Response samples of import tasks +- [List](#list---list-import-tasks) +- [Show](#show---show-an-import-task) + +### List - list import tasks + +**Import by files** +``` json +{ + "meta": { + "status": 200 + }, + "data": [ + { + "id": 177, + "file": { + "name": "string2.po" + }, + "status": "in-progress", + "created_at": "2013-10-07T15:25:00+0000", + "created_at_timestamp": 1381159500 + }, + { + "id": 176, + "file": { + "name": "string.po" + }, + "status": "in-progress", + "created_at": "2013-10-07T15:27:10+0000", + "created_at_timestamp": 1381159630 + } + ] +} +``` + +**Import by phrase collections** +``` json +{ + "meta": { + "status": 200 + }, + "data": [ + { + "id": 266, + "collection_count": 5, + "status": "in-progress", + "created_at": "2013-10-07T15:25:00+0000", + "created_at_timestamp": 1381159500 + }, + { + "id": 265, + "collection_count": 3, + "status": "in-progress", + "created_at": "2013-10-07T15:27:10+0000", + "created_at_timestamp": 1381159630 + } + ] +} +``` + +#### Show - show an import task + +**Import by files** +``` json +{ + "meta": { + "status": 200 + }, + "data": { + "id": 176, + "file": { + "name": "string.po", + "format": "GNU_PO", + "locale": { + "code": "en-US", + "english_name": "English (United States)", + "local_name": "English (United States)", + "locale": "en", + "region" : "US" + } + }, + "string_count": 236, + "word_count": 1260, + "status": "in-progress", + "created_at": "2013-10-07T15:27:10+0000", + "created_at_timestamp": 1381159630 + } +} +``` + +**Import by phrase collections** +``` json +{ + "meta": { + "status": 200 + }, + "data": { + "id": 265, + "collection_count": 3, + "status": "in-progress", + "created_at": "2013-10-07T15:27:10+0000", + "created_at_timestamp": 1381159630 + } +} +``` diff --git a/resources/import_task.md b/resources/import_task.md index e2bd01d..32fef64 100644 --- a/resources/import_task.md +++ b/resources/import_task.md @@ -1,7 +1,92 @@ ## Import Task +- [List](#list---list-import-tasks) - [Show](#show---show-an-import-task) +### List - list import tasks + + GET https://platform.api.onesky.io/1/projects/:project_id/import-tasks + +**Authentication** + +Required. Details described [here](/README.md#authentication) + +**Parameters** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameRequired?DefaultSampleDescription
pageoptional1Set page number to retrieve. (min: 1)
per_pageoptional50Set how many groups to retrieve for each time. (max: 100, min: 1)
statusoptionalallin-progress + Filter to show only import tasks of specific status with one of the followings: +
    +
  • all - All tasks
  • +
  • completed - Tasks imported successfully
  • +
  • in-progress - Tasks are being handling or waiting for others to finish
  • +
  • failed - Tasks failed while processing
  • +
+
+ +**Response** + +``` json +{ + "meta": { + "status": 200 + }, + "data": [ + { + "id": 177, + "file": { + "name": "string2.po" + }, + "status": "in-progress", + "created_at": "2013-10-07T15:25:00+0000", + "created_at_timestamp": 1381159500 + }, + { + "id": 176, + "file": { + "name": "string.po" + }, + "status": "in-progress", + "created_at": "2013-10-07T15:27:10+0000", + "created_at_timestamp": 1381159630 + } + ] +} +``` +Remark: +- `status` can be either `completed`, `in-progress` or `failed`. +- Response may vary according to the way used to import strings. More response sample [here](/reference/import_tasks_response_samples.md). + +[Back to top](#import-task) + ### Show - show an import task GET https://platform.api.onesky.io/1/projects/:project_id/import-tasks/:import_id @@ -42,6 +127,8 @@ NONE } } ``` -Remark: `status` can be either `completed`, `in-progress` or `failed`. +Remark: +- `status` can be either `completed`, `in-progress` or `failed`. +- Response may vary according to the way used to import strings. More response sample [here](/reference/import_tasks_response_samples.md). [Back to top](#import-task) From a570c27263afa90e3c8b672ad182da678705c3e0 Mon Sep 17 00:00:00 2001 From: Victor Lam Date: Mon, 17 Feb 2014 17:16:46 +0800 Subject: [PATCH 3/3] add anchor to link --- resources/import_task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/import_task.md b/resources/import_task.md index 32fef64..eadc3fe 100644 --- a/resources/import_task.md +++ b/resources/import_task.md @@ -83,7 +83,7 @@ Required. Details described [here](/README.md#authentication) ``` Remark: - `status` can be either `completed`, `in-progress` or `failed`. -- Response may vary according to the way used to import strings. More response sample [here](/reference/import_tasks_response_samples.md). +- Response may vary according to the way used to import strings. More response sample [here](/reference/import_tasks_response_samples.md#list---list-import-tasks). [Back to top](#import-task) @@ -129,6 +129,6 @@ NONE ``` Remark: - `status` can be either `completed`, `in-progress` or `failed`. -- Response may vary according to the way used to import strings. More response sample [here](/reference/import_tasks_response_samples.md). +- Response may vary according to the way used to import strings. More response sample [here](/reference/import_tasks_response_samples.md#show---show-an-import-task). [Back to top](#import-task)