Skip to content

Latest commit

 

History

History
223 lines (193 loc) · 6.01 KB

File metadata and controls

223 lines (193 loc) · 6.01 KB

File

List - list uploaded files

GET https://platform.api.onesky.io/1/projects/:project_id/files

Authentication

Required. Details described here

Parameters

Name Required? Default Sample Description
page optional 1 Set page number to retrieve. (min: 1)
per_page optional 50 Set how many groups to retrieve for each time. (max: 100, min: 1)

Response

status 200 OK
{
    "meta": {
        "status": 200,
        "record_count": 16
    },
    "data": [
        {
            "name": "strings.po",
            "string_count": 236,
            "last_import": {
                "id": 123,
                "status": "in-progress"
            },
            "uploaded_at": "2013-10-07T15:27:10+0000",
            "uploaded_at_timestamp": 1381159630
        },
        {
            "name": "en.yml",
            "string_count": 335,
            "last_import": {
                "id": 109,
                "status": "completed"
            },
            "uploaded_at": "2013-10-05T12:36:52+0000",
            "uploaded_at_timestamp": 1380976612
        },
        {
            "name": "Manually input",
            "string_count": 285,
        },
        ...
    ]
}

Remark:

  • status can be either completed, in-progress or failed.
  • Manual input strings will display as a separate file with no last_import, uploaded_at and uploaded_at_timestamp.
  • Import history is accessible up to one year. For files imported longer than one year ago, id will display as 0 and status will display as completed.

Back to top

Upload - upload a file

Add or update strings by file.

POST https://platform.api.onesky.io/1/projects/:project_id/files

Authentication

Required. Details described here

Parameters

Name Required? Default Sample Description
file required File contains strings to translate
file_format required IOS_STRINGS Specify the input format. Please refer to format list
locale optional [base language] zh-TW Specify the input language. If locale is different from base language, the strings will add to translation strings. Please refer to GET locales
is_keeping_all_strings optional true For strings that cannot be found in newly uploaded file with same file name, keep those strings unchange if set to true. Deprecate those strings if set to false. Notice that different files will not interfere each other in the same project. For example, with setting is_keeping_all_strings to false, uploading en2.po will not deprecate strings of previously uploaded file, en.po.
is_allow_translation_same_as_original optional false This setting applies to translation upload, skip importing translations that are the same as source text if set to false. Keeping the translations that are the same as source text if set to true.

Request

Since this endpoint required to upload file, please use Content-Type: multipart/form-data for the request and submit the request like a form data.

Response

status 201 Created
{
    "meta": {
        "status": 201
    },
    "data": {
        "name": "string.po",
        "format": "GNU_PO",
        "language": {
            "code": "en-US",
            "english_name": "English (United States)",
            "local_name": "English (United States)",
            "locale": "en",
            "region" : "US"
        },
        "import": {
            "id": 154,
            "created_at": "2013-10-07T15:27:10+0000",
            "created_at_timestamp": 1381159630
        }
    }
}

Remark: After string file uploaded, string import process will be performed in background. Please check the import status via Import Task endpoint by using the import.id provided.

Back to top

Delete - delete a file

DELETE https://platform.api.onesky.io/1/projects/:project_id/files

Authentication

Required. Details described here

Parameters

Name Required? Default Sample Description
file_name required string.po Specify name of file to delete.

Response

status 200 OK
{
    "meta": {
        "status": 200
    },
    "data": {
        "name": "string.po"
    }
}

Back to top