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": [
{
"file_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
},
{
"file_name": "en.yml",
"string_count": 335,
"last_import": {
"id": 109,
"status": "completed"
},
"uploaded_at": "2013-10-05T12:36:52+0000",
"uploaded_at_timestamp": 1380976612
},
{
"file_name": "Manually input",
"string_count": 285,
},
...
]
}Remark:
statuscan be eithercompleted,in-progressorfailed.- Manual input strings will display as a separate file with no
last_import,uploaded_atanduploaded_at_timestamp.
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. |
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.
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"
}
}