New in V2
Smartling is rolling out a new, expanded suite of APIs. Beginning with Authentication and Files APIs. API v1 is still supported but will be deprecated on October 31, 2017.
Version 2 of FilesAPI will be familiar to you if you’ve used v1 but there are some important differences to keep in mind while you’re getting started.
See our Migration guide for help getting started.
V2 APIs replace the single API key with Oauth 2.0 authentication, requiring an access token to be included in the header of every request. Tokens are obtained via an Authenticate request containing a User ID and User Secret.
See Authentication for more information.
Some V2 URLs contain path variables that you need to consider when you write your calls. In FilesAPI there are two path variables that may appear in a URL.
projectId- the unique identifier for a Smartling project. You can find this information in the Smartling dashboard at Project Settings > API.
locale- the locale code for a translated file. You can find a full list of locale codes used in each of your projects in the Smartling dashboard at Project Settings > API.
Some terminology and parameter names in v2 are different from their v1 equivalents. Changes include
- To bring the API in line with Smartling's Dashboard terminology, the API uses 'authorize' instead of 'approve'. For example, the
localesToApproveparameter in the v1 version of Upload File call is now
- URLs now use hyphens (-) instead of underscores (_). For example:
Most Smartling API arguments are strings, but some v2 calls take arrays as arguments to return information on multiple files or locales. The correct format for passing array values differ depending on your request format.
As part of a query string in a GET request:
Don’t forget the square brackets for array values, even if you’re only passing a single argument.
As multipart form parameters:
-F "localeIdsToAuthorize=fr-FR" -F "localeIdsToAuthorize=de-DE"
As part of a raw JSON request body:
If you’re already using v1 of Smartling’s File API, you may be able to improve on your integration with the new, more powerful calls included in v2. Significant new options include:
You now have four different options for downloading files:
- Check last modified dates for a selected locale or all locales.