OneSky Dev

OneSky Classic API is deprecated and only available for Over-the-air iOS SDK users.
Please use the new Platform API in order to utilize all of the new features.

Get started with API You have to get your API Key and API Secret by registering as Admin in OneSkyApp first.

http://api.oneskyapp.com/2

https://api.oneskyapp.com/2

The prefix of all APIs.

Parameters

  • string api-key
    Your own API key. ESSENTIAL for every request.
  • int timestamp (optional)
    Unix Timestamp in interger format. For those Translation I/O or Project Management APIs, you'll need to pass also your timestamp with Dev Hash.
  • string dev-hash (optional)
    For those Translation I/O or Project Management APIs, you'll need to pass also your Dev Hash.
  • dev-hash = MD5( CONCATENATE( timestamp , YOUR_API_SECRET ) )

Sample Request

https://api.oneskyapp.com/2/string/output?api-key=your-key&dev-hash=TheHash&platform-id=1&timestamp=1355555555

Project Management API

/projects

Return all projects under your account

Method

GET

Parameters

  • None
{
    "projects": [
        {
            "id": 1,
            "name": "OneSky",
            "base_locale": "en_US"
        },
        {
            "id": 2,
            "name": "TwoSky...s",
            "base_locale": "en_US"
        }
    ]
}

/project/platforms

Return all platforms in a project

Method

GET

Parameters

  • string project
    The name of the project specified.
{
    "platforms": [
        {
            "id": 1,
            "type": "iPhone/iPad App",
            "code": "ios"
        },
        {
            "id": 2,
            "type": "Miscelleneous",
            "code": "misc",
            "description": "database"
        }
    ]
}

/project/add

Add a project

Method

POST

Parameters

  • string name
    The name of the project specified.
  • string base-locale
    The locale of base language. Locales could be found in /locales.
{
    "response": "ok"
}

/project/details

Get the information of the project

Method

GET

Parameters

  • string project
    The name of the project
{
    "project": {
        "name": "Website",
        "base_locale": "en_US"
    }
}

/project/modify

Modify a project

Method

POST

Parameters

  • string project
    The name of the project to be changed.
  • string new-name
    The new name of the project.
{
    "response": "ok"
}

/project/delete

Delete a project

Method

POST

Parameters

  • string project
    The name of the project.
{
    "response": "ok"
}

Translation I/O API

/string/output

Get the strings with translations.

This API is designed for handling large amount of requests at the same time. The results may delay for several seconds.

Method

GET

Parameters

  • int platform-id
    The ID of the platform which contains the strings. Could be found in /project/platforms .
  • string locale (optional)
    The locale of the translation. Available in API /platform/locales. Translations in all locales will be returned if not specified.
  • string tag (optional)
    The tag of the string. A string would be able to be associated with multi-tags.
  • string md5 (optional)
    The hash value of the result. If it is the same as the hash value of the result, no strings will be returned.
  • string version (optional)
    Get the strings from the version of specified platform, current version if not specified.
  • boolean is-fallback (optional)
    Fallback to parent language to get translations if strings in selected language are not yet translated.

Return

{
    "translation": {
        "Tag A": {
            "Locale A": {
                "String Key A": "string",
                "String Key B": {
                    "Context A": "string",
                    "Context B": "string"
    	        }
            },
            "Locale B": {
                "String Key A": "string"
            }
        },
        "Tag B": {
            "Locale A": {
                "String Key C": "string"
            }
        }
    },
    "md5": "95e6198f16ea363291dfa9bc18282545"
}
{
    "translation": {
        "common": {
            "en_US": {
                "Account": "Account",
                "Active Translators": "Active Translators",
                "Add": "Add",
                "%{number} languages available": "%{number} languages available",
                "book": {
                	"verb": "book",
                	"noun": "book"
                }
            },
            "zh_TW": {
                "Add": "加入"
            }
        }
    },
    "md5": "95e6198f16ea363291dfa9bc18282545"
}
// md5 matched
{
    "response": "up-to-date"
}

/string/upload

Upload a string file to add new strings. Send out email to user when strings input finished.

The imported file will be sent to an import queue, the API response doesn't mean the file has been fully imported.

Method

POST

Parameters

  • int platform-id
    The ID of the platform to be added strings. Could be found in /project/platforms .
  • file file
    The file containing strings.
  • string format
    String file format, must be one of the listed items.
    • IOS_STRINGS
    • GNU_PO
    • ANDROID_XML
    • ANDROID_JSON
    • JAVA_PROPERTIES
    • RUBY_YML
    • FLASH_XML
    • GNU_POT
    • PLIST_XML
    • RRC
    • RESX
    • RUBY_YAML
    • RESJSON
    • HIERARCHICAL_JSON
    • PHP
    • PHP_VARIABLES
    • HTML
    • HTML
    • RESW
    • YML
    • YAML
    • ADEMPIERE_XML
    • QT_TS_XML
    • TMX
    • L10N
    • INI
    • MD
    • XML_REDROCKET
    • XML_PROPERTIES
    • XLIFF
    • XLIFF_Symfony
    • XLF
    • XML_BONUSXP
    • TXT_STRINGS
    • TXT_INI
    • IDEMPIERE_XML
    • MULTILINGUAL_JSON
    • IOS_STRINGSDICT_XML
    • JAVA_LANG
    • I18NEXT_HIERARCHICAL_JSON
    • I18NEXT_MULTILINGUAL_JSON
    • REQUIREJS
    • BADLAND_JSON
    • MYSIMPLESTATS_JS
    • PHP_SHORT_ARRAY
  • string version (optional)
    Upload strings to the version of specified platform, current version if not specified.
  • string callback-url (optional)
    Send out a HTTP callback to specified URL when strings input finished.
  • string locale (optional)
    The language code. Available in API /platform/locales. Base language of the platform if not specified.

Callback Parameters [GET]

project
Project name.
filename
Name of the uploaded string file.
total
Total number of strings found.
success
Number of successfully input strings.

Return

{
    "response": "upload-in-progress"
}

/string/download

Download strings and translations as string file.

This API is designed for handling large amount of requests at the same time. The results may delay for several seconds.

Method

GET

Parameters

  • int platform-id
    The ID of the platform contains the strings. Could be found in /project/platforms .
  • string locale
    The language code. Available in API /platform/locales.
  • string tag
    The tag of the string. A string would be able to be associated with multi-tags.
  • string format (optional)
    String file format, must be one of the listed items. AUTO if not specified.
    • IOS_STRINGS
    • GNU_PO
    • GNU_MO
    • ANDROID_XML
    • JAVA_PROPERTIES
    • RUBY_YML
    • FLASH_XML
    • GNU_POT
    • PLIST_XML
    • RRC
    • RESX
    • RUBY_YAML
    • RESJSON
    • HIERARCHICAL_JSON
    • PHP
    • PHP_VARIABLES
    • HTML
    • HTML
    • RESW
    • YML
    • YAML
    • ADEMPIERE_XML
    • QT_TS_XML
    • TMX
    • L10N
    • INI
    • XLIFF
    • XLIFF_Symfony
    • XLF
    • TXT_STRINGS
    • TXT_INI
    • IDEMPIERE_XML
    • HIERARCHICAL_JSON_PRETTY
    • MULTILINGUAL_JSON
    • IOS_STRINGSDICT_XML
    • JAVA_LANG
    • I18NEXT_HIERARCHICAL_JSON
    • I18NEXT_MULTILINGUAL_JSON
    • REQUIREJS
    • IOS_STRINGS_FALLBACK
    • BADLAND_JSON
    • MYSIMPLESTATS_JS
    • PHP_SHORT_ARRAY
    • HIERARCHICAL_JSON_NO_SOURCE
  • string version (optional)
    Download strings from the version of specified platform, current version if not specified.

Return

HTTP file download

Translation Order API

/translate/quote

Quote for the strings need to be translated.

Method

GET

Parameters

  • int platform-id
    The ID of the platform contains the strings. Could be found in /project/platforms .
  • string version (optional)
    Get the strings from the version of specified platform, current version if not specified.
  • string from-locale (optional)
    The locale you want to translate from. Must be translated in advance. Available in API /platform/locales. Original locale if not specified.
  • string to-locale
    The locale you want to translate to. Available in API /platform/locales
  • string filter (optional)
    Strings to be quoted, must be one of the listed items. NO_TRANSLATION if not specified.
    • ALL - All strings
    • NO_HUMAN - Strings not translated by human translator
    • NO_TRANSLATION - Strings never been translated

Return

{
    "agencies": [
        {
            "id": 1,
            "name": "Google",
            "turnaround_time": 0,
            "amount": 0,
            "min_charge": 0,
            "type": "TRANSLATION",
            "from_locale": "en_US",
            "to_locale": "zh_TW",
            "is_machine": true
        },
        {
            "id": 2,
            "name": "OneSky Translation",
            "turnaround_time": 2,
            "amount": 56.72,
            "min_charge": 30,
            "type": "TRANSLATION",
            "from_locale": "en_US",
            "to_locale": "zh_TW",
            "is_machine": false
        }
    ],
    "credits": 395.87
}
id
ID of the agency.
name
Name of the agency.
turnaround_time
Expected working days needed. If 0, will be finished in a few minutes.
amount
Cost of the order (USD).
min_charge
Minimum charge from the agency (USD).
type
Type of the order.
from_locale
The locale you want to translate from.
to_locale
The locale you want to translate to.
is_machine
The agency returns machine translations.
credits
Credit remains in your account.

/translate/order

Order translation. Will use credits when place order. Please recharge credits in your account management page if needed.

Method

GET

Parameters

  • int platform-id
    The ID of the platform contains the strings. Could be found in /project/platforms .
  • string version (optional)
    Get the strings from the version of specified platform, current version if not specified.
  • int agency-id
    The ID of the agency. Could be found in /translate/quote .
  • string from-locale (optional)
    The locale you want to translate from. Must be translated in advance. Available in API /platform/locales. Original locale if not specified.
  • string to-locale
    The locale you want to translate to. Available in API /platform/locales
  • string filter (optional)
    String file format, must be one of the listed items. NO_TRANSLATION if not specified.
    • ALL - All strings
    • NO_HUMAN - Strings not translated by human
    • NO_TRANSLATION - Strings never been translated

Return

{
    "response": "ok"
}
{
    "response": "No string to be translated"
}

Platform Management API

/platform/details

Get the information of the platform

Method

GET

Parameters

Return

{
    "platform": {
        "project": "Website",
        "base_locale": "en_US",
        "type": {
            "name": "iPhone/iPad App",
            "code": "ios"
        }
    }
}

/platform/add

Add a platform into a project

Method

POST

Parameters

  • string project
    The name of the project the platform will be added.
  • string type
    The platform Type of the new platform. The platform type list could be retrieved from /platform-types.
  • string description (optional)
    Description of the platform when the platform type is miscellaneous
  • int string-publish-threshold (optional)
    The vote threshold needed for the strings to be published within this platform. Default 3.
  • int string-confirm-threshold (optional)
    The vote threshold needed for the strings to be confirmed within this platform. Must be greater or equals to string-publish-threshold. Default 20
  • string accessible-by (optional)
    The accessibility of the platform. Possible values: public, private. Default public

Return

{
    "platform": {
        "result": "Created",
        "platform-id": 1
    }
}

/platform/modify

Modify a platform and its languages

Method

POST

Parameters

  • int platform-id
    ID of the platform. Could be found in /project/platforms .
  • string type (optional)
    The type of platform. The platform type list could be retrieved from /platform-types.
  • string description (optional)
    Description of the platform when the platform type is miscellaneous
  • int string-publish-threshold (optional)
    The vote threshold needed for the strings to be published within ALL languages this project. Will remain unchanged if no input.
  • int string-confirm-threshold (optional)
    The vote threshold needed for the strings to be confirmed within ALL languages this project. Must be greater or equals to string-publish-threshold. Will remain unchanged if no input.
  • string accessible-by (optional)
    The accessibility of ALL languages in the project. Possible values: public, private. Will remain unchanged if no input.

Return

{
    "response": "ok"
}

/platform/locales

Get the details of activated locales for a platform

Method

GET

Parameters

Return

{
    "locales": [
        {
            "locale": "en_US",
            "name": {
            	"eng": "English (US)",
            	"local": "English (US)"
            },
            "locale_ios": "en",
            "custom_locale" : null,
            "is_active": true,
            "is_private": false,
            "string_select_threshold": 3,
            "string_confirm_threshold": 20,
            "completeness": 0,
        },
        {
            "locale": "zh_TW",
            "name": {
      	      	"eng": "Traditional Chinese",
            	"local": "繁體中文"
            },
            "locale_ios": "zh-Hant",
            "custom_locale" : "zh-Custom",
            "is_active": true,
            "is_private": false,
            "string_select_threshold": 3,
            "string_confirm_threshold": 20,
            "completeness": 0,
        },
		...
     ]
}

/platform/delete

Delete a platform

Method

POST

Parameters

Return

{
    "response": "ok"
}

/platform/import

Import phrases and translations into a platform from another.

Only "approved" translations will be imported

Method

POST

Parameters

  • int platform-id
    ID of the platform. Could be found in /project/platforms .
  • int from-platform-id
    ID of the platform the strings come from. Could be found in /project/platforms .
  • string locales (optional)
    The locales for import, separated by commas (e.g. en_US,zh_TW,es_ES). Default base locale only. Locales could be found in /locales.

Return

{
    "response": "import-in-progress"
}

Translator API

/translator/contribution

Get the contribution data of a translator

Parameters

  • int platform-id
    ID of the platform. Could be found in /project/platforms .
  • string email
    The email of the translator.
  • string locale(optional)
    Contribution to the locale. If not specified, sum all locales up. Could be found in /platform/locales

Method

GET

Return (WITHOUT parameter locale)

{
    "contribution": {
        "all": {
            "string_translated": 21,
            "word_translated": 142,
            "string_selected": 8,
            "word_selected": 44,
            "string_confirmed": 2,
            "word_confirmed": 14,
            "good_vote_received": 138,
            "bad_vote_received": 23,
            "good_vote_gave": 212,
            "bad_vote_gave": 43
        }
    }
}

Return (WITH parameter language)

{
    "contribution": {
        "en_US": {
            "string_translated": 12,
            "word_translated": 86,
            "string_selected": 3,
            "word_selected": 21,
            "string_confirmed": 1,
            "word_confirmed": 12,
            "good_vote_received": 53,
            "bad_vote_received": 13,
            "good_vote_gave": 45,
            "bad_vote_gave": 24
        }
    }
}

Utility API

/locales

Get available locale list.

Method

GET

Return

{
    "locales": [
        {
            "locale": "en_US",
            "name": {
                "eng": "English (US)",
                "local": "English (US)"
            },
            "locale_ios": "en"
        },
        {
            "locale": "af_ZA",
            "name": {
                "eng": "Afrikaans",
                "local": "Afrikaans"
            }
        },
        {
            "locale": "sq_AL",
            "name": {
                "eng": "Albanian",
                "local": "Shqip"
            }
        },
     ...
}

/platform-types

Get available platform type list.

Method

GET

Return

{
    "types": [
        {
            "name": "iPhone/iPad App",
            "code": "ios"
        },
        {
            "name": "Android App",
            "code": "android"
        },
        {
            "name": "Website",
            "code": "website"
        },
        {
            "name": "Miscellaneous",
            "code": "misc"
        }
    ]
}

Get the Single-Sign-On link for logging in.

Method

POST

Parameters

  • string unique-id
    The unique ID of the user in your App. We'll map it with OneSkyApp for the first time and no more authentication needed by accessing this link.
  • string name
    Displaying name of your user.
  • string locale (optional)
    The locale you want to be accessible by this user. We will automatically add this user as a collaborator for this locale.
  • string project (optional) (requires locale) (comma separated)
    Project IDs you want to be accessible by this user. We will automatically add this user as a collaborator for these projects.

    If locale is specified but project is not specified, we will add this user as a collaborator to all your projects containing the specified locale.

Return (WITHOUT parameter locale)

{
    "url": "https:\/\/translate.oneskyapp.com\/?time=1290495566&id=abc@oneskyapp.com&data=d98e3fc22ba4bce8537bfef7929f1fc5&name=Leon",
    "md5": "7f4d51e53b0e2fec49262840caa29720"
}

Return (WITH parameter locale)

{
    "url": "https:\/\/translate.oneskyapp.com\/?time=1290495566&id=abc@oneskyapp.com&data=d98e3fc22ba4bce8537bfef7929f1fc5&name=Leon&locale=fr_FR",
    "md5": "7f4d51e53b0e2fec49262840caa29720"
}

Return (WITH parameter locale and project )

{
    "url": "https:\/\/translate.oneskyapp.com\/?time=1290495566&id=abc@oneskyapp.com&data=d98e3fc22ba4bce8537bfef7929f1fc5&name=Leon&locale=fr_FR&project=1,2,3",
    "md5": "7f4d51e53b0e2fec49262840caa29720"
}