Welcome to the Smartling Help Center!

Smartling's Translation Management Platform is a solution that prioritizes process automation and collaboration so that teams can quickly and cost-effectively localize websites, apps, and documents with minimal IT involvement.

The Help Center is Smartling's documentation repository for the UI and API.

Overview

 

This section contains technical documentation (API v2) for developers.

For API v1 and UI documentation:

  • For API v1, click here. Note: The Smartling API v1 is in maintenance and will not release any new endpoints. When possible, use API v2 for the latest endpoints.

  • For business rules, and general information on managing translations in Smartling, see the Documentation section.

Welcome to our Developer Documentation.

This section contains information for developers on integrating the power of the Smartling platform into your project. The more effort you put into integration and automation, the less time you have to spend administering translation work.

API

Smartling's API is extensive and still growing. Almost any action you can take inside the Smartling Dashboard can also be done via API, and if it can't yet, we're probably working on it. Watch this space for updates as we release new endpoints.

This documentation covers Smartling API version 2. Version 1 is set to be deprecated on October 1, 2017 and should be avoided in new integrations. (Deprecation of v1: For customers using API v1, it will continue to work as-is after October 1, 2017, but we do recommend migrating to v2.)

Files

If your project uses translatable resource files, you can customize how Smartling parses your file into translatable strings. Consult the File Support section of our documentation for more information on all file types supported by Smartling, directives you can add to files to change how they are parsed, and advice for working with common frameworks.

Available APIs

 

Glossary

The Glossary API allows for managing individual glossary terms and translations and for importing and exporting Glossary files.

Context

The Context API supports uploading various forms of context - images and HTML - and associated the context with content in Smartling.

Authentication

The Authentication API provides the methods to authenticate API calls.

String

The String API allows for creating individual strings not associated with files and downloading translated strings.

Issues

The Issues API allows for manipulation of source and translation issues.

Files

The Files API allows for uploading, downloading and checking status on files in the Smartling platform.

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 1 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.

Authentication

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 info.

Path Variables

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.

New Terminology

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 localesToApprove parameter in the v1 version of Upload call is now localeIdsToAuthorize in v2
  • URLs now use hyphens (-) instead of underscores (_). For example: /last_modified is now /last-modified

Arrays

Most Smartling API arguments are strings, but some v2 calls take arrays as arguments to return information on multiple files or locales.

www-url-encoded:

?localeId[]=de-DE&localeId[]=fr-FR

Don’t forget the square brackets for array values, even if you’re only passing a single argument.

Form Parameters:

 -F "localeId[]=fr-FR" -F "localeId[]=de-DE"

JSON:

{"localeIds":["es-ES","zh-CN"]}

New Options

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:
    • Download a single translated file;
    • Download all locales for a single file as a .ZIP archive
    • Download multiple files for multiple locales as a .ZIP archive
    • Download translations for all locales in a single CSV file
  • Choose between detailed status of a file in a single locale or a summary for all locales.
  • Check last modified dates for a selected locale

Migrate to v2

 

Many of Smartling’s v1 API methods are scheduled to be deprecated October 1 2017, so all users should start preparing to transition to v2 methods. Migrating your existing integrations from v1 to v2 requires four steps.

Create an authentication strategy

Where v1 requests were authorized with an API key, v2 requests use Oauth 2.0. A valid access token must be included in the header of each request. This means that you need to set up some way of passing a valid token to your API requests. See Authentication for full details. Depending on how you are using the API, there are two main approaches:

  • Make a separate Authentication request before each request to obtain an access token. If accessing the API intermittently or as part of a script, this is likely to be the easiest solution.
  • Set up a process to obtain and periodically refresh an access token, then make it available as a variable. Consider this approach if you’re integrating Smartling into an application or making a high volume of requests.

Change your requests to use path variables

While v1 request URLs were static, v2 APIs use path variables to identify projects and locales. To switch to v2, you’ll need to update how you assemble your requests to generate the correct request URL for the project and locale you want to access.

Switch over to v2 URLs

Smartling’s v2 API gives you some new options for managing your content (see New in v2 for details). Consider taking advantage of the new endpoints when you switch to v2. To maintain your current functionality, see the table below for the most direct v2 equivalent of each v1 endpoint.

Update necessary parameters - especially Arrays

Many v2 requests use similar parameters to their v1 equivalents, with a few key differences. Parameters that referenced ‘Approve’ in v1, now use ‘Authorize’ to match the terminology used in the Smartling Dashboard. Additionally, some requests now take Array arguments. These are marked in the documentation for each request. Array arguments must be passed in array format, even if there is only one value.

You should now be ready to start using Smartling API v2.

Callbacks

 

Some events in Smartling can trigger callbacks to a specified URL. Callbacks usually let you know when an action is completed. For example, a file or string is translated in a particular locale or a translation job is complete.

General Information

  • Callbacks are issued from IP 184.73.255.141. To make sure you receive necessary callbacks, you should whitelist this IP address.

Callbacks

String is translated for a locale

This callback is sent to the URL provided in the Create Strings request. It can be sent as a GET or POST request, thouh only the POST request includes translations. The POST request looks like:

{
  "projectId": "51df0cf05",
  "hashcode": "3325fc569a651bef02a93732e48701b4",
  "localeId": "fr-FR",
  "type": "string.localeCompleted",
  "translations": [
    {
      "translation": "Bonjour!",
      "pluralForm": null,
      "modifiedDate": "2016-12-01T14:18:00Z"
    }
  ]
}

A GET request includes the same information - with the exception of the translations object as querystring parameters: ?projectID=9db9036e6 etc.

Type of Callback Received for Different Job Entities (jobs, strings, files)

Jobs
A job callback is sent when a job is Completed, Cancelled or a Locale of the Job is Completed

Job Completed:
The callback will contain the translationJobUid, type=job.completed

Locale Completed:
The callback will contain the translationJobUid, type=job.localeCompleted, localeId
Job Cancelled
The callback will contain the translationJobUid, type=job.cancelled, ts

Strings
String Completed:
For now, a callback will only be sent when the string is completed for a locale. Additional types may be added down the road.
The callback will contain the hashcode, projectId, localeId and a type=string.localeCompleted

Files
File Completed:
No type has been added to File callbacks. It is only sent when the file is complete. The callback will contain fileUri and "locale" (Note, this is locale, not localeId).

Rate Limiting

 

Smartling API imposes rate limits on requests to ensure that resources are shared fairly among clients. If you make a high number of requests in a short time period, some requests may fail.

If rate limiting is applied, a 429 MAX_OPERATIONS_LIMIT_EXCEEDED response will be sent. Your integration should be setup to wait and retry a request if a 429 response is received.

Where possible, spread out your requests to avoid running into rate-limiting issues.

Response Format

 

Success

Success responses are encoded into a generalized JSON structure with two basic properties: a response code, and a custom data object.

{
    "response": {
        "code": "SUCCESS",
        "data": {
            "localeId": "de-DE",
            "lastModified": "[YYYY-MM-DDThh:mm:ssZ]"
        }
    }
}

Errors

Error responses include an array of errors, each with a key and message explaining the details of the error. Some errors may give additional details.

{
    "response": {
         "code": "VALIDATION_ERROR",
         "errors": [{
              "key": "parse.error",
              "message": "There was a problem loading your file. No source strings found; Check your configuration http://goo.gl/OW6Q1o",
              "details": {
                   "errorId": "cse8rqnf"
              }
         }]
  }
}

Response Codes

Value Description HTTP Code
SUCCESS If the service request was processed normally 200
ACCEPTED It an asynchronous task, such as a file upload, has begun, but is not completed at the time the response is sent. 202
VALIDATION_ERROR If something specific was wrong with the request parameters provided. One or more will describe the particular invalid parameter. 400
AUTHENTICATION_ERROR If the provided credentials were not valid. 401
AUTHORIZATION_ERROR Legacy error code from API 401
RESOURCE_LOCKED The requested file is currently being processed by another operation. The file will be unlocked after the operation completes. See Upload for more details. 423
MAX_OPERATIONS_LIMIT_EXCEEDED Too many simultaneous API requests per project or file. 429
GENERAL_ERROR If an unexpected error occurred during the service request processing. 500
MAINTENANCE_MODE_ERROR If Smartling has entered maintenance mode, all API services will return this error. After exiting maintenance mode all services should return to normal. 503

SDKs

 

Smartling makes a variety of SDKs available for Java, Python, and PHP.

CLI (Command Line Interface)

 

Smartling CLI Tool is currently in alpha release.

Commands and parameters are subject to change.

  • Works on most platforms without dependencies.
  • Works with Smartling's API v2.
  • Automatically manages authentication (obtains access token and refresh, if required).
  • Performs batch operations in parallel (download\upload\get status).
  • Supports Files and Project API so far.
  • Package managers (brew\apt-get\yum) coming soon.
  • Do you need more? Send us your use cases!

In addition to our language specific SDKs, clients have used our BASH scripts or otherwise directly accessed the Smartling API. The CLI (Command Line Interface) tool is designed as a replacement for direct access, and replaces our BASH scripts for accessing v2 of the API. Follow these steps to get you started with uploading, downloading, and getting a full list of files in Smartling's Files API.

Download and Documentation

All the details for installing and using the CLI tool are in the public GitHub page. Go to Smartling CLI.

Best Practices for Storing Credentials

The most convenient way to use the tool is to create configuration file(s) that will store your basic credentials and preferences. The 'init' command can help with this.

Your config file has sensitive information. We recommend using best practices for securely storing your credentials.

The following information from Amazon Web Services covers this topic and the same is applicable to your Smartling CLI Tool initialization file.

Glossaries

 

List Glossaries for an Account

Returns a list of all glossaries in an account. Optional filters for glossary name and UID can be added.

 
gethttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries

Path Params

accountUid
string
required

Query Params

name
string

filter for glossary name in LIKE manner (case-insensitive)

glossaryUids
array of strings

filter for glossary uid in IN manner (might contain up to 100 uids separated by comma e.g glossaryUids=1234,4567)

curl --request GET \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "glossaryUid": "50d9dab5-6b8b-11e5-ba24-127b00b163a3",
          "name": "Another document tester-Glossary",
          "createdByUserUid": "ah27fhq8",
          "createdDate": "2015-11-21T01:51:17Z",
          "sourceLocaleId": "en-US",
          "description": "some desc"
        },
        {
          "glossaryUid": "50e5c8d3-6b8b-11e5-ba24-127b00b163a3",
          "name": "BizDocs test Max's project-Glossary",
          "createdByUserUid": "ah27fhq8",
          "createdDate": "2015-11-21T01:51:17Z",
          "sourceLocaleId": "en-US",
          "description": "some desc"
        }
      ]
    }
  }
}

Create glossary

Creates a new Glossary in an account.

 
posthttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries

Path Params

accountUid
string
required

Body Params

name
string
required
description
string
required
sourceLocaleId
string
required

A valid Smartling Locale ID

curl --request POST \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "glossaryUid": "50d9dab5-6b8b-11e5-ba24-127b00b163a3",
      "name": "Another document tester-Glossary",
      "description": "Description of a Glossary",
      "sourceLocaleId": "en-US",
      "createdByUserUid": "ah27fhq8",
      "createdDate": "2015-11-21T01:51:17Z"
    }
  }
}

Get glossary details

Gets the name, description, locale, and creation information for a glossary.

 
gethttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid

Path Params

accountUid
string
required
glossaryUid
string
required
curl --request GET \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Edit a glossary

Edits the name, description or source locale of a glossary. This will completely replace the name, description and source locale of the target glossary. If you do not provide a field, or leave it blank, any existing information will be deleted.

 
puthttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid

Path Params

accountUid
string
required
glossaryUid
string
required
curl --request PUT \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Delete Glossary

Deletes a Glossary. Note that if a Glossary has been assigned to a Linguistic Package, you will not be able to delete it. Linguistic Packages are managed in the Smartling Dashboard.

 
deletehttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid

Path Params

accountUid
string
required
glossaryUid
string
required
curl --request DELETE \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "termText": "cold call",
      "partOfSpeechCode": "VERB",
      "definition": "",
      "notes": "",
      "caseSensitive": false,
      "exactMatch": false,
      "variations": "",
      "synonyms": "",
      "antonyms": "",
      "seo": false,
      "doNotTranslate": false,
      "translation": {
        "localeId": "fr-CA",
        "translatedTerm": "cold call french ca",
        "notes": "some notes from user",
        "translatorUserUid": "58870b8e965",
        "submittedForTranslation": true,
        "lockTranslation": false
      }
    }
  }
}

Glossary terms

 

Get glossary terms

Returns terms from a Glossary. Only the source term is included in this response.

 
gethttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms

Path Params

accountUid
string
required
glossaryUid
string
required

Query Params

termText
string

filter for term text in LIKE manner (case-insensitive).

limit
integer

pagination portion size

offset
integer

pagination offset value

sort
string

sorting instructions. represents field to sort by and direction separated by coma (i.e. sort=termText,desc). We support sorting by all fields.

curl --request GET \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "termUid": "e390a4d6-aef2-11e5-b159-0ad0c2f6b537",
          "termText": "cold calls",
          "caseSensitive": false,
          "exactMatch": false,
          "partOfSpeechCode": "UNSPECIFIED",
          "definition": "",
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": false,
          "doNotTranslate": false,
          "deprecated": false,
          "notes": "",
          "createdDate": "2015-12-30T12:43:12Z",
          "modifiedDate": "2015-12-30T12:43:12Z"
        },
        {
          "termUid": "e390a4d6-aef2-11e5-b159-0ad0c2f6b538",
          "termText": "cold call",
          "caseSensitive": true,
          "exactMatch": false,
          "partOfSpeechCode": "VERB",
          "definition": "My definition",
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": false,
          "doNotTranslate": false,
          "deprecated": false,
          "notes": "My notes",
          "createdDate": "2015-12-30T12:43:12Z",
          "modifiedDate": "2015-12-30T12:43:12Z"
        }
      ]
    }
  }
}

Create glossary term

Creates a new glossary term. The only required parameter is termText. See our Glossary documentation for details on each term parameter. You can only add one translation object in this request. To add additional translations, use Edit Glossary term.

 
posthttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms

Path Params

accountUid
string
required
glossaryUid
string
required
curl --request POST \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "termText": "cold call",
      "partOfSpeechCode": "VERB",
      "definition": "",
      "notes": "",
      "caseSensitive": false,
      "exactMatch": false,
      "variations": "",
      "synonyms": "",
      "antonyms": "",
      "seo": false,
      "doNotTranslate": false,
      "translation": {
        "localeId": "fr-CA",
        "translatedTerm": "cold call french ca",
        "notes": "some notes from user",
        "translatorUserUid": "58870b8e965",
        "submittedForTranslation": true,
        "lockTranslation": false
      }
    }
  }
}

Create glossary terms in batch

Creates a new glossary terms.Validation for the endpoint works in atomic fashion - either all terms passed validation, and then they all will be created, or non of them will be. Translation section is optional.

 
posthttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/batch

Path Params

accountUid
string
required
glossaryUid
string
required
curl --request POST \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/batch
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/batch' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/batch");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/batch"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "termText": "term 22",
          "partOfSpeechCode": "UNSPECIFIED",
          "definition": "",
          "notes": "",
          "caseSensitive": false,
          "exactMatch": false,
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": false,
          "doNotTranslate": false
        },
        {
          "termText": "term 33",
          "partOfSpeechCode": "UNSPECIFIED",
          "definition": "",
          "notes": "",
          "caseSensitive": false,
          "exactMatch": false,
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": false,
          "doNotTranslate": false,
          "translation": {
            "localeId": "fr-CA",
            "translatedTerm": "term 33 french ca",
            "notes": "some notes from user",
            "translatorUserUid": "58870b8ee965",
            "submittedForTranslation": false,
            "lockTranslation": false
          }
        }
      ]
    }
  }
}

Get Glossary Terms and Translations

Returns terms from a Glossary, including translations for the specified locale.

 
gethttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/locales/localeId/terms

Path Params

accountUid
string
required
glossaryUid
string
required
localeId
string
required

Query Params

termUids
array of strings

UIDs of specific terms to be retrieved (validation allows not more than 100 in single request)

termText
string

filter for term text in LIKE manner (case-insensitive).

translated
boolean

flag to filter out terms by criteria of presence of translation. if not specified - it is not taken into account

limit
integer

pagination portion size

offset
integer

pagination offset value

sort
string

sorting instructions. represents field to sort by and direction separated by coma (i.e. sort=termText,desc). We support sorting by all fields.

curl --request GET \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/locales/localeId/terms
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/locales/localeId/terms' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/locales/localeId/terms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/locales/localeId/terms");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/locales/localeId/terms"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "translation": {
            "createdDate": "2015-12-30T12:43:12Z",
            "modifiedDate": "2015-12-30T12:43:12Z",
            "localeId": "fr-CA",
            "translatedTerm": "cold calls in french ca",
            "notes": "",
            "submittedForTranslation": true,
            "translatorUserUid": "58870b8ee964",
            "lockTranslation": false
          },
          "termUid": "e390a4d6-aef2-11e5-b159-0ad0c2f6b537",
          "termText": "cold calls",
          "caseSensitive": false,
          "exactMatch": false,
          "partOfSpeechCode": "UNSPECIFIED",
          "definition": "",
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": false,
          "doNotTranslate": false,
          "deprecated": false,
          "notes": "",
          "createdDate": "2015-12-30T12:43:12Z",
          "modifiedDate": "2015-12-30T12:43:12Z"
        },
        {
          "translation": {
            "createdDate": "2015-12-30T12:43:12Z",
            "modifiedDate": "2015-12-30T12:43:12Z",
            "localeId": "fr-CA",
            "translatedTerm": "cold call french ca",
            "notes": "",
            "submittedForTranslation": false,
            "translatorUserUid": "58870b8ee966",
            "lockTranslation": false
          },
          "termUid": "e390a4d6-aef2-11e5-b159-0ad0c2f6b538",
          "termText": "cold call",
          "caseSensitive": false,
          "exactMatch": false,
          "partOfSpeechCode": "ADJECTIVE",
          "definition": "",
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": false,
          "doNotTranslate": false,
          "deprecated": false,
          "notes": "",
          "createdDate": "2015-12-30T12:43:12Z",
          "modifiedDate": "2015-12-30T12:43:12Z"
        }
      ]
    }
  }
}

Returns terms with translations for particular locale for multiple glossaries

If performance is an issue, and client wants to avoid makeing several calls to get terms from different glossaries - this call serves this purpose. Glossary uid is omitted from URI path, but security check is performed that all requested terms belong to glossaries which are connected to account specified in path. Validation works in atomic fashion - either all terms comply criteria, or non is accepted.
Response contains glossary uids for every term, to show which glossary term belongs to (glossaryUid field in response is specific for this API call only).

 
gethttps://api.smartling.com/glossary-api/v2/accounts/accountUid/locales/localeId/terms

Path Params

accountUid
string
required
localeId
string
required

Query Params

termUids
array of strings

UIDs of specific terms to be retrieved (validation allows not more than 100 in single request)

termText
string

filter for term text in LIKE manner (case-insensitive).

translated
boolean

flag to filter out terms by criteria of presence of translation. if not specified - it is not taken into account

limit
integer

pagination portion size

offset
integer

pagination offset value

sort
string

sorting instructions. represents field to sort by and direction separated by coma (i.e. sort=termText,desc). We support sorting by all fields.

curl --request GET \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/locales/localeId/terms
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/locales/localeId/terms' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/locales/localeId/terms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/locales/localeId/terms");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/locales/localeId/terms"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "translation": {
            "localeId": "fr-FR",
            "translatedTerm": "arabian architecture in french",
            "notes": "",
            "translatorUserUid": null,
            "lockTranslation": false,
            "submittedForTranslation": false,
            "createdDate": "2015-10-21T11:08:01Z",
            "modifiedDate": "2015-10-27T13:09:56Z"
          },
          "termUid": "6b3e1e8c-eb40-4c32-a9f7-024e407b0b30",
          "termText": "arabian architecture",
          "caseSensitive": true,
          "exactMatch": false,
          "partOfSpeechCode": "VERB",
          "definition": "",
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": true,
          "doNotTranslate": false,
          "deprecated": false,
          "notes": "",
          "createdByUserUid": "kjakjf82v",
          "glossaryUid": "bdf416ee-98ff-11e5-b159-0ad0c2f6b537",
          "createdDate": "2015-10-19T15:48:34Z",
          "modifiedDate": "2015-11-09T15:33:19Z"
        },
        {
          "translation": {
            "localeId": "fr-FR",
            "translatedTerm": "summer time french 22",
            "notes": "",
            "translatorUserUid": null,
            "lockTranslation": false,
            "submittedForTranslation": false,
            "createdDate": "2015-12-02T14:28:00Z",
            "modifiedDate": "2015-12-02T14:28:00Z"
          },
          "termUid": "aaf416ee-98ff-11e5-b159-0ad0c2f6b537",
          "termText": "summer time",
          "caseSensitive": false,
          "exactMatch": false,
          "partOfSpeechCode": "ADJECTIVE",
          "definition": "",
          "variations": "",
          "synonyms": "",
          "antonyms": "",
          "seo": false,
          "doNotTranslate": false,
          "deprecated": false,
          "notes": "",
          "createdByUserUid": "kjakjf82v",
          "glossaryUid": "bbf416ee-98ff-11e5-b159-0ad0c2f6b537",
          "createdDate": "2015-12-02T14:19:15Z",
          "modifiedDate": "2015-12-02T14:19:15Z"
        }
      ]
    }
  }
}

Edit glossary term

Edits the details of a glossary term. With the exception of the translation object, you must provide all desired fields every time you edit the term. If you do not provide a field or leave it blank, any existing value for that field will be deleted. To add translations for multiple locales, make a separate request for each locale. Keep all fields except for the translation object identical in each request.

 
puthttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid

Path Params

accountUid
string
required
glossaryUid
string
required
termUid
string
required
curl --request PUT \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Delete term

Delete a Glossary term. This will remove the term and all translations.

 
deletehttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid

Path Params

accountUid
string
required
glossaryUid
string
required
termUid
string
required
curl --request DELETE \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/terms/termUid"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Authorize terms for translation

 

Authorize terms for translation

Sends selected terms for translation via specified workflows to chosen target locales.

 
puthttps://api.smartling.com/glossary-api/v2/projects/projectUid/glossaries/glossaryUid/terms/authorization

Path Params

projectUid
string
required
glossaryUid
string
required

Body Params

termUids
array of strings
required
authorization
curl --request PUT \
  --url https://api.smartling.com/glossary-api/v2/projects/projectUid/glossaries/glossaryUid/terms/authorization
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.smartling.com/glossary-api/v2/projects/projectUid/glossaries/glossaryUid/terms/authorization' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/projects/projectUid/glossaries/glossaryUid/terms/authorization")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.smartling.com/glossary-api/v2/projects/projectUid/glossaries/glossaryUid/terms/authorization");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/projects/projectUid/glossaries/glossaryUid/terms/authorization"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Export Glossary

 

Download glossary

Downloads a glossary as a CSV, TBX or XLSX (Open Excel) file.

 
gethttps://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/download

Path Params

accountUid
string
required
glossaryUid
string
required

Query Params

format
string
required
localeIds
string

Comma-separated list of locales for which to return translations

curl --request GET \
  --url 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/download?format=format'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/download',
  qs: { format: 'format' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/download?format=format")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/download?format=format");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/glossaries/glossaryUid/download"

querystring = {"format":"format"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Create New Glossary from Excel File

 

Create new glossary from Excel file

Creates a new Glossary in your account from an uploaded Excel spreadsheet. The format of the spreadsheet is important. See Import Glossary and Glossary Spreadsheet Format.

 
posthttps://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs

Path Params

accountUid
string
required

Form Data

name
string
required

A name for the glossary. This name must be unique. Attempting to use a name already in use in the account will return an error.

sourceLocaleId
string
required

Source locale for the glossary.

description
string
required

Description for the glossary

importFile
file
required

File containing the Glossary you want to import. See Glossary Spreadsheet Format for details.

curl --request POST \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "glossaryImportJobUid": "78d93dde-5e3d-4beb-8171-415f82ca2c7b",
      "glossary": {
        "glossaryUid": "5c8d2aa8-e254-4ab3-8eb3-3b96b24f8609",
        "name": "Import keysight test",
        "accountUid": "8a196313",
        "createdByUserUid": "58870b8ee965",
        "sourceLocaleId": "en",
        "description": "test desc",
        "createdDate": "2016-05-18T12:04:38Z"
      },
      "fileName": "ExampleImportGlossary2.xlsx",
      "accountUid": "b76d6285",
      "glossaryImportJobStatus": "PENDING",
      "termsNumber": 10,
      "termsProcessed": 0,
      "localesNumber": 20,
      "createdDate": "2016-03-21T15:00:48Z",
      "modifiedDate": "2016-03-21T15:00:48Z",
      "createdByUserUid": "58870b8ee965"
    }
  }
}

Create New Glossary from Excel File - Check Status

 

Create new Glossary from Excel file - check status

Checks the status of a glossary import.

 
gethttps://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs/glossaryImportJobUid

Path Params

accountUid
string
required
glossaryImportJobUid
string
required
curl --request GET \
  --url https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs/glossaryImportJobUid
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs/glossaryImportJobUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs/glossaryImportJobUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs/glossaryImportJobUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/accounts/accountUid/import-jobs/glossaryImportJobUid"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "glossaryImportJobUid": "78d93dde-5e3d-4beb-8171-415f82ca2c7b",
      "glossary": {
        "glossaryUid": "5c8d2aa8-e254-4ab3-8eb3-3b96b24f8609",
        "name": "Import keysight test",
        "accountUid": "8a196313",
        "createdByUserUid": "58870b8ee965",
        "sourceLocaleId": "en",
        "description": "test desc",
        "createdDate": "2016-05-18T12:04:38Z"
      },
      "fileName": "ExampleImportGlossary2.xlsx",
      "accountUid": "b76d6285",
      "glossaryImportJobStatus": "PENDING",
      "termsNumber": 10,
      "termsProcessed": 0,
      "localesNumber": 20,
      "createdDate": "2016-03-21T15:00:48Z",
      "modifiedDate": "2016-03-21T15:00:48Z",
      "createdByUserUid": "58870b8ee965"
    }
  }
}

Dictionary calls

 

Get list of parts of speech

Order is fixed and consistent throughout the calls.

 
gethttps://api.smartling.com/glossary-api/v2/dictionary/parts-of-speech
curl --request GET \
  --url https://api.smartling.com/glossary-api/v2/dictionary/parts-of-speech
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/glossary-api/v2/dictionary/parts-of-speech' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/glossary-api/v2/dictionary/parts-of-speech")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/glossary-api/v2/dictionary/parts-of-speech");

xhr.send(data);
import requests

url = "https://api.smartling.com/glossary-api/v2/dictionary/parts-of-speech"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "code": "SUCCESS",
  "data": {
    "totalCount": 9,
    "items": [
      {
        "partOfSpeechCode": "NOUN",
        "description": "Noun"
      },
      {
        "partOfSpeechCode": "VERB",
        "description": "Verb"
      },
      {
        "partOfSpeechCode": "ADJECTIVE",
        "description": "Adjective"
      },
      {
        "partOfSpeechCode": "ADVERB",
        "description": "Adverb"
      },
      {
        "partOfSpeechCode": "PRONOUN",
        "description": "Pronoun"
      },
      {
        "partOfSpeechCode": "PREPOSITION",
        "description": "Preposition"
      },
      {
        "partOfSpeechCode": "INTERJECTION",
        "description": "Interjection"
      },
      {
        "partOfSpeechCode": "CONJUNCTION",
        "description": "Conjunction"
      },
      {
        "partOfSpeechCode": "UNSPECIFIED",
        "description": "Unspecified"
      }
    ]
  }
}

Contexts

 

Upload new context.

The Upload Context endpoint request body takes the form of a multi-part post request,
with each part having it's own content type, e.g. for HTML context:

  POST /context-api/v2/projects/a06b5c7e1/contexts HTTP/1.1
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="content"; filename="context.html"
  Content-Type: text/html

  <!DOCTYPE html>
  <html lang="en">
  <head>
      <title>Page title</title>
  </head>
  <body>
      <div class="sl-translate">
          <p>String 1</p>
      </div>
      <div class="sl-translate">
          <p>String 2</p>
      </div>
  </body>
  </html>

  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="name"

  /path/to/custom_context-name.html
  ------WebKitFormBoundary7MA4YWxkTrZu0gW--

For VIDEO context, "content" part should be omitted and the "name" part should contain the public link to video:

  POST /context-api/v2/projects/a06b5c7e1/contexts HTTP/1.1
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="name"

  http://video.domain.com/path_to_video.mp4
  ------WebKitFormBoundary7MA4YWxkTrZu0gW--
 

Header Auth

 Authentication is required for this endpoint.
posthttps://api.smartling.com/context-api/v2/projects/projectId/contexts

Path Params

projectId
uuid
required

Form Data

content
file
required

The context file part with content type. Supported content types are image/* and text/html.

name
string

Optional parameter that overrides the file name of content part.

curl --request POST \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "contextUid": "6e66fe6b-b508-4849-9e65-1e502d65755d",
      "contextType": "IMAGE",
      "name": "image.png",
      "created": "2017-05-03T20:47:38Z"
    }
  }
}
{
  "response": {
    "code": "VALIDATION_ERROR",
    "requestId": "2b963af9-c1bc-4f9e-80b6-0d6cb8fa55cf",
    "data": {
      "errors": [
        {
          "key": "wrong_parameters",
          "message": "Check request parameters, error message - 'Content stream is required for this context.', ref id: 'af4706d9-c5c1-40aa-93e4-1ec3498c1f05'"
        }
      ]
    }
  }
}

List contexts for project

Returns a list of metadata for all context files in a project, including the unique ID, type of context, file name and created date. Response is limited to 100 items, to retreive all items the request should be repeated with offset parameter specified.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.smartling.com/context-api/v2/projects/projectId/contexts

Path Params

projectId
uuid
required

Query Params

nameFilter
string

Optional filter for context names

offset
string

If your original request returns an offset value, the set of results is incomplete. Run the request again, with the given offset value to see more results. When offset is null, there are no more results to return.

type
string

Optional context type filter.

curl --request GET \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "items": [
        {
          "name": "image.png",
          "contextType": "IMAGE",
          "contextUid": "6e66fe6b-b508-4849-9e65-1e502d65755d",
          "created": "2016-12-19T17:28:29Z"
        },
        {
          "contextUid": "ac79677f-0e0a-4d01-b4e3-b94e2e6ba09c",
          "contextType": "IMAGE",
          "name": "image-context.jpg",
          "created": "2016-11-11T13:23:32Z"
        }
      ],
      "offset": null
    }
  }
}

View context metadata

Retrieves basic context information.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid

Path Params

projectId
uuid
required
contextUid
uuid
required
curl --request GET \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "contextUid": "6e66fe6b-b508-4849-9e65-1e502d65755d",
      "contextType": "VIDEO",
      "name": "http://custom-video-hosting.com/path/to/video.mp4",
      "created": "2017-05-03T20:47:38Z"
    }
  }
}
{
  "response": {
    "code": "NOT_FOUND_ERROR",
    "errors": [
      {
        "key": "not_found_error",
        "message": "Context not found, ref id: 'ffd90ec4-5ca8-4720-8ecf-15dce3404823'"
      }
    ]
  }
}

Delete the context.

Removes the context and all associated bindings of this context to strings.

 

Header Auth

 Authentication is required for this endpoint.
deletehttps://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid

Path Params

projectId
uuid
required
contextUid
uuid
required
curl --request DELETE \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": null
  }
}
{
  "response": {
    "code": "NOT_FOUND_ERROR",
    "errors": [
      {
        "key": "not_found_error",
        "message": "Context not found, ref id: 'ffd90ec4-5ca8-4720-8ecf-15dce3404823'"
      }
    ]
  }
}

Download content of the context file.

Returns binary image data for IMAGE context,
html document with bindings anchors for HTML context.
Empty response for VIDEO context.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/content

Path Params

projectId
uuid
required
contextUid
uuid
required
curl --request GET \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/content
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/content",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/content")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/content' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/content"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

<html>
  <head>
    <title>Document title</title>
  </head>
  <body>
    <div data-sl-anchor="11">html file contents</div>
  </body>
</html>
{
  "response": {
    "code": "NOT_FOUND_ERROR",
    "errors": [
      {
        "key": "not_found_error",
        "message": "Context not found, ref id: 'ffd90ec4-5ca8-4720-8ecf-15dce3404823'"
      }
    ]
  }
}

Run automatic context matching.

Automatically matches a Context against strings in the project and creates corresponding bindings.
Optical Character Recognition (OCR) is used for IMAGE context, while HTML context uses approximate string matching algorithm.
Optionally, you can restrict matching to only a set of strings that you specify to ensure that no unwanted bindings are created.
This is a convenience method provided to save time and complexity in your integration.
While our OCR functionality is advanced, it cannot match 100% of strings.
If you need complete context coverage, either use the manual Create Bindings request or check your context images in the Smartling Dashboard after running this request to fill in any blanks.
Be mindful of the limitations of OCR if you are using an unusual or script-like font.

 

Header Auth

 Authentication is required for this endpoint.
posthttps://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match/async

Path Params

projectId
uuid
required
contextUid
uuid
required

Body Params

stringHashcodes
array of strings
curl --request POST \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match/async
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match/async",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match/async")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match/async' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match/async"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "matchId": "ffd90ec4-5ca8-4720-8ecf-15dce3404823"
    }
  }
}
{
  "response": {
    "code": "VALIDATION_ERROR",
    "errors": [
      {
        "key": "wrong_parameters",
        "message": "Check request parameters, error message - 'Context with Uid=cb081827-2daa-4611-915c-4d207829be27 doesn't exist', ref id: '11f8b832-8154-4e6e-a196-a69a88009736'",
        "details": null
      }
    ]
  }
}

Retrieve asynchronous match results

Check the status of the match request and get results once the match is completed.
When the match has been completed, any newly created bindings are also returned in the response.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.smartling.com/context-api/v2/projects/projectId/match/matchId

Path Params

projectId
uuid
required
matchId
uuid
required

Identifier of the match request obtained when running asynchronous match request.

curl --request GET \
  --url https://api.smartling.com/context-api/v2/projects/projectId/match/matchId
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/match/matchId",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/match/matchId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/match/matchId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/match/matchId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "matchId": "a9308883-30c7-4832-a023-6c3b10f6f9b1",
      "createdDate": "2017-05-05T19:06:22Z",
      "modifiedData": "2017-05-05T19:06:22Z",
      "status": "COMPLETED",
      "bindings": [
        {
          "bindingUid": "a9308883-30c7-4832-a023-6c3b10f6f9b1",
          "contextUid": "428bf090-60fa-473d-ac07-4a551aa06c47",
          "stringHashcode": "374825f7d147fb5700f23b2b22d6660d",
          "anchors": [
            "11",
            "custom.anchor"
          ]
        },
        {
          "bindingUid": "a9308883-30c7-4832-a023-6c3b10f6f9b1",
          "contextUid": "428bf090-60fa-473d-ac07-4a551aa06c47",
          "stringHashcode": "374825f7d147fb5700f23b2b22d6660d",
          "anchors": [
            "12"
          ]
        }
      ]
    }
  }
}
{
  "response": {
    "code": "NOT_FOUND_ERROR",
    "errors": [
      {
        "key": "not_found",
        "message": "Match not found"
      }
    ]
  }
}

Bindings

 

Remove binding.

Deletes a context binding. The context referenced by the binding will no longer be displayed for the referenced string in the Translation Interface.

 

Header Auth

 Authentication is required for this endpoint.
deletehttps://api.smartling.com/context-api/v2/projects/projectId/bindings/bindingUid

Path Params

projectId
uuid
required
bindingUid
uuid
required

Unique identifier for the binding you want to delete

curl --request DELETE \
  --url https://api.smartling.com/context-api/v2/projects/projectId/bindings/bindingUid
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/bindings/bindingUid",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/bindings/bindingUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/bindings/bindingUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/bindings/bindingUid"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": null
  }
}
{
  "response": {
    "code": "NOT_FOUND_ERROR",
    "errors": [
      {
        "key": "not_found_error",
        "message": "Binding not found"
      }
    ]
  }
}

Return all bindings for the context.

Return all bindings that reference a given piece of context.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/bindings

Path Params

projectId
uuid
required
contextUid
uuid
required
curl --request GET \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/bindings
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/bindings",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/bindings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/bindings' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/bindings"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 1,
      "items": [
        {
          "bindingUid": "d6414f8c-4gdf-4415-9a69-f8e7902ca9ec",
          "contextUid": "25137b65-e075-4341-8362-14b1a3e558f5",
          "stringHashcode": "bd603147d945h3ec74d6874422ebe4e0",
          "coordinates": {
            "top": 50,
            "left": 50,
            "bottom": 400,
            "right": 400
          }
        }
      ]
    }
  }
}
{
  "response": {
    "code": "NOT_FOUND_ERROR",
    "errors": [
      {
        "key": "not_found_error",
        "message": "Context not found, ref id: 'ffd90ec4-5ca8-4720-8ecf-15dce3404823'"
      }
    ]
  }
}

Get bindings for the string

Return all bindings that reference a given string.

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.smartling.com/context-api/v2/projects/projectId/strings/stringHashcode/bindings

Path Params

projectId
uuid
required
stringHashcode
hash
required

Hashcode for the string you want to get bindings for.

curl --request GET \
  --url https://api.smartling.com/context-api/v2/projects/projectId/strings/stringHashcode/bindings
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/strings/stringHashcode/bindings",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/strings/stringHashcode/bindings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/strings/stringHashcode/bindings' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/strings/stringHashcode/bindings"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 1,
      "items": [
        {
          "bindingUid": "d6414f8c-4gdf-4415-9a69-f8e7902ca9ec",
          "contextUid": "25137b65-e075-4341-8362-14b1a3e558f5",
          "stringHashcode": "bd603147d945h3ec74d6874422ebe4e0",
          "coordinates": {
            "top": 50,
            "left": 50,
            "bottom": 400,
            "right": 400
          }
        }
      ]
    }
  }
}

Create bindings.

Link context images with the strings they contain. The binding tells Smartling which context images to show translators for which strings.
A maximum of 150 bindings can be created per request. A request with more than 150 items will return a 400 response indicating validation error.
Basic bindings request should contain an object with "bindings" JSON array with at least one element (binding), featuring contextUid and stringHashcode properties:

{
  "bindings": [
    {
       "contextUid": "25137b65-e075-4341-8362-14b1a3e558f5",
       "stringHashcode": "bd603147d945h3ec74d6874422ebe4e0"
    }
  ]
}

For IMAGE context, each binding may have additional coordinates data, which specifies rectangular area, where the string is located in the image. If not specified, binding will still be created with coordinates [0,0,0,0]:

{
  "bindings": [
    {
       "contextUid": "25137b65-e075-4341-8362-14b1a3e558f5",
       "stringHashcode": "bd603147d945h3ec74d6874422ebe4e0",
       "coordinates": {
          "top": 50,
          "left": 50,
          "width": 400,
          "height": 400
       }
    }
  ]
}

For HTML context, each binding may have the anchors array, specifying the enclosing the string HTML elements with the corresponding value of the data-sl-anchor attribute. If not specified, binding will still be created with the empty anchors array:

{
  "bindings": [
    {
       "contextUid": "25137b65-e075-4341-8362-14b1a3e558f5",
       "stringHashcode": "bd603147d945h3ec74d6874422ebe4e0",
       "selector": {
          "anchors": ["custom.anchor", "11", 44"]
       }
    }
  ]
}

For VIDEO context, each binding mave the timecode data, specifying the start and end time of the string appearance in the video:

{
  "bindings": [
    {
        "contextUid": "25137b65-e075-4341-8362-14b1a3e558f5",
        "stringHashcode": "bd603147d945h3ec74d6874422ebe4e0",
        "timecode": {
           "startTime": 1203,
           "endTime": 1450
        }
    }
  ]
}
 

Header Auth

 Authentication is required for this endpoint.
posthttps://api.smartling.com/context-api/v2/projects/projectId/bindings

Path Params

projectId
uuid
required

Project ID

Body Params

bindings
array of objects

Array of string-to-context bindings

contextUid
stringHashcode
coordinates 
timecode 
selector 
curl --request POST \
  --url https://api.smartling.com/context-api/v2/projects/projectId/bindings
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/bindings",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/bindings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/bindings' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/bindings"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 1,
      "items": [
        {
          "bindingUid": "d6414f8c-4gdf-4415-9a69-f8e7902ca9ec",
          "contextUid": "25137b65-e075-4341-8362-14b1a3e558f5",
          "stringHashcode": "bd603147d945h3ec74d6874422ebe4e0",
          "coordinates": {
            "top": 50,
            "left": 50,
            "bottom": 400,
            "right": 400
          }
        }
      ]
    }
  }
}
{
  "response": {
    "code": "VALIDATION_ERROR",
    "errors": [
      {
        "key": "wrong_parameters",
        "message": "Please, limit number of bindings to no more than 150 in one request"
      }
    ]
  }
}

**DEPRECATED** Run automatic match.

Automatically matches a Context Image against strings in the project using Optical Character Recognition (OCR) for IMAGE context and creates bindings for any found matches.
Optionally, you can restrict OCR matching to only a set of strings that you specify to ensure that no unwanted bindings are created.
This is a convenience method provided to save time and complexity in your integration. While our OCR functionality is advanced, it cannot match 100% of strings.
If you need complete context coverage, either use the manual Create Bindings request or check your context images in the Smartling Dashboard after running this request to fill in any blanks.
Be mindful of the limitations of OCR if you are using an unusual or script-like font.
DEPRECATED in favor of asynchronous matching.

 

Header Auth

 Authentication is required for this endpoint.
posthttps://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match

Path Params

projectId
uuid
required
contextUid
uuid
required

Body Params

stringHashcodes
array of strings
curl --request POST \
  --url https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests

url = "https://api.smartling.com/context-api/v2/projects/projectId/contexts/contextUid/match"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "newBindings": [
        {
          "bindingUid": "fc2azc89-f0fc-43c4-9c3a-8e6u0521b092",
          "contextUid": "456efpe5-0bf5-4482-365f-a0nce127abb0",
          "stringHashcode": "4d70a525c0e49fe8a3b43e5b76ae33d9",
          "coordinates": {
            "top": 114,
            "left": 589,
            "height": 33,
            "width": 346
          }
        },
        {
          "bindingUid": "4c0a343c-d361-4315-9580-60cdfed3dc37",
          "contextUid": "456ef9e5-0zf5-4382-b65f-a00ce127abb0",
          "stringHashcode": "e5a03bi0d4cd78e1c29bde61e6898fa1",
          "coordinates": {
            "top": 55,
            "left": 16,
            "height": 20,
            "width": 90
          }
        }
      ]
    }
  }
}

Authentication

 

Authenticate

Authenticates the user with a User Identifier and Secret. Returns an access token that can be attached to the header of any API request to authenticate the user, and a refresh token which can be used to obtain a new access token.

 
posthttps://api.smartling.com/auth-api/v2/authenticate

Body Params

userIdentifier
string
required

API v2 user identifier

userSecret
string
required

API v2 user secret

curl --request POST \
  --url https://api.smartling.com/auth-api/v2/authenticate
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/auth-api/v2/authenticate' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/auth-api/v2/authenticate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/auth-api/v2/authenticate");

xhr.send(data);
import requests

url = "https://api.smartling.com/auth-api/v2/authenticate"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "accessToken": "b816424c-2e95-11e7-93ae-92361f002671",
      "refreshToken": "c0a6f410-2e95-11e7-93ae-92361f002671",
      "expiresIn": 480,
      "refreshExpiresIn": 3660,
      "tokenType": "Bearer"
    }
  }
}

Refresh access token

Returns a renewed access token that can be attached to the header of any API request to authenticate the user, and a refresh token which can be used to obtain a new access token.

 
posthttps://api.smartling.com/auth-api/v2/authenticate/refresh

Body Params

refreshToken
string
required

The refresh token returned from a previous authentication request

curl --request POST \
  --url https://api.smartling.com/auth-api/v2/authenticate/refresh
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/auth-api/v2/authenticate/refresh' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/auth-api/v2/authenticate/refresh")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/auth-api/v2/authenticate/refresh");

xhr.send(data);
import requests

url = "https://api.smartling.com/auth-api/v2/authenticate/refresh"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Create Strings

 

Create Strings

Uploads an array of strings to a Smartling project. A maximum of 100 strings can be created per request. A request with more than 100 items will return an error. Each string has a character limit of 10 000.

Note that you cannot authorize a string via API. Once you have created the strings, they will need to be authorized by a content owner in the Smartling Dashboard.

Smartling creates a unique hashcode for each string based on the parsed string text and any variant or namespace metadata provided. If you upload a string with the same text, variant and namespace, and therefore the same hashcode, the existng string will be overwritten. This will not change the text of the string, but may update other metadata, such as placeholder and callback values. If the string is currently inactive, overwriting it will cause it to be reactivated. Overwritten strings return "overWritten": "true" in the response object.

Most uploads will return a 200 response indicating success. If processing the request takes longer than 60 seconds, a 202 request will be returned, including a processUid value that can be used to check on the progress of the request.

If you set up a POST callback for the string, you can automatically receive the translation for a string as soon as it is complete. See Callbacks for more details.

 
posthttps://api.smartling.com/strings-api/v2/projects/projectId

Path Params

projectId
uuid
required

Body Params

placeholderFormat
string

Specifies a standard placeholder format. Accepted values are none, c, ios, python, java, yaml, qt, resx. For more detail on placeholders see Placeholders in Resource Files

placeholderFormatCustom
string

Specifies a custom placeholder with a Java Regular Expression. For example \[.+?\] would capture all values surrounded by square brackets as placeholders. For more detail on placeholders see Placeholders in Resource Files

namespace
string

Used to generate the unique hashcode for all strings in the request. If you want to have two versions of a string with the same text and variant metadata, you can keep them unique by assigning a different namespace to each string. If not provided, default value is smartling.strings-api.default.namespace. A NULL value is permitted.

strings
array of objects
stringText
variant
callbackUrl
callbackMethod
instruction
format
curl --request POST \
  --url https://api.smartling.com/strings-api/v2/projects/projectId
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/strings-api/v2/projects/projectId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/strings-api/v2/projects/projectId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/strings-api/v2/projects/projectId");

xhr.send(data);
import requests

url = "https://api.smartling.com/strings-api/v2/projects/projectId"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "wordCount": 4,
      "stringCount": 1,
      "processUid": "d6414f8c-4gdf-4415-9a69-f8e7902ca9ec",
      "items": [
        {
          "variant": "variant value",
          "stringText": "Search results for [city]:",
          "parsedStringText": "Search results for {0}:",
          "hashcode": "bd603147d945h3ec74d6874422ebe4e0",
          "overWritten": "true"
        }
      ]
    }
  }
}

Check String Status

 

Check string status

If a Create Strings request takes longer than 60 seconds to process, a 202 response will be returned, indicating that the process of creating strings is continuing but not yet complete. This response will include a proccessUid value which can be used to check the progress of the request. This request returns a processState value of open, indicating that the request is still continuing, closed, indicating the request has successfully completed, and failed, meaning the request could not be completed.

Processes have a limited lifespan after they are complete. This request will fail if you specify an expired processUid.

 
gethttps://api.smartling.com/strings-api/v2/projects/projectId/processes/processUid

Path Params

projectId
uuid
required
processUid
uuid
required
curl --request GET \
  --url https://api.smartling.com/strings-api/v2/projects/projectId/processes/processUid
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/strings-api/v2/projects/projectId/processes/processUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/strings-api/v2/projects/projectId/processes/processUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/strings-api/v2/projects/projectId/processes/processUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/strings-api/v2/projects/projectId/processes/processUid"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Get Source Strings

 

Get source strings

Returns source strings from Smartling. You can get strings by specifying a file you want strings for, or you can specify individual strings by hashcode.

If you do not specify at least one of these parameters (hashcodes or fileUri) no results will be returned.

Note that if you use this call to get strings not created with the strings API, you may see differences in the response.

You may see a value for parsedStringText but a null value for stringText. The stringText records the raw input received by the String API so will only appear for strings uploaded via String API.
If you are getting a GDN string, the original placeholder values you used will not be returned, as these are not saved by Smartling. GDN strings will have placeholders in the format {0}, {1}, etc.

 
gethttps://api.smartling.com/strings-api/v2/projects/projectId/source-strings

Path Params

projectId
uuid
required

Form Data

hashcodes
array of strings

Hashcodes for each string you want to get source strings for.

fileUri
string

URI of a file you want to get strings for.

limit
number

Pagination setting. By default responses will be limited to 500 per request. This is also the maximum allowed value.

offset
number

Pagination setting. Default is 0.

curl --request GET \
  --url https://api.smartling.com/strings-api/v2/projects/projectId/source-strings
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/strings-api/v2/projects/projectId/source-strings' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/strings-api/v2/projects/projectId/source-strings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/strings-api/v2/projects/projectId/source-strings");

xhr.send(data);
import requests

url = "https://api.smartling.com/strings-api/v2/projects/projectId/source-strings"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Get Translations

 

Get translations

Returns translated strings from Smartling. You can get translations by specifying a file you want strings for, or you can specify individual strings by hashcode.

If you do not specify at least one of these parameters (hashcodes or fileUri) no results will be returned.

Note that if you use this call to get strings not created with the strings API, you may see differences in the response.

Only authorized and active strings will be returned. Excluded, unauthorized & inactive strings will not be returned.

You may see a value for parsedStringText but a null value for stringText. The stringText records the raw input received by the String API so will only appear for strings uploaded via String API.
If you are getting a GDN string, the original placeholder values you used will not be returned, as these are not saved by Smartling. GDN strings will have placeholders in the format {0}, {1}, etc.

 
gethttps://api.smartling.com/strings-api/v2/projects/projectId/translations

Path Params

projectId
uuid
required

Form Data

hashcodes
array of strings

Hashcodes for each string you want to get translations for.

targetLocaleId
string

Smartling ID for the language you want to get translations for.

retrievalType
string

Sets the types of translations you want returned. published will only return translations that have completed their workflows and been published. pending will return any saved translations.

fileUri
string

URI of a file you want to get translations for.

limit
number

Pagination setting. By default responses will be limited to 500 per request. This is also the maximum allowed value.

offset
number

Pagination setting. Default is 0.

curl --request GET \
  --url https://api.smartling.com/strings-api/v2/projects/projectId/translations
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/strings-api/v2/projects/projectId/translations' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/strings-api/v2/projects/projectId/translations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/strings-api/v2/projects/projectId/translations");

xhr.send(data);
import requests

url = "https://api.smartling.com/strings-api/v2/projects/projectId/translations"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Dictionaries

 

Get Issue Types

This request returns all current issue types. Smartling may occasionally add or change the list of allowed issue types.

 
gethttps://api.smartling.com/issues-api/v2/dictionary/issue-types
curl --request GET \
  --url https://api.smartling.com/issues-api/v2/dictionary/issue-types
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/issues-api/v2/dictionary/issue-types' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/dictionary/issue-types")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/issues-api/v2/dictionary/issue-types");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/dictionary/issue-types"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "description": "Source",
          "issueTypeCode": "SOURCE",
          "subTypes": [
            {
              "issueSubTypeCode": "CLARIFICATION",
              "description": "Clarification"
            },
            {
              "issueSubTypeCode": "MISSPELLING",
              "description": "Misspelling"
            }
          ]
        },
        {
          "description": "Translation",
          "issueTypeCode": "TRANSLATION",
          "subTypes": [
            {
              "issueSubTypeCode": "POOR_TRANSLATION",
              "description": "Poor Translation"
            },
            {
              "issueSubTypeCode": "DOES_NOT_FIT_SPACE",
              "description": "Doesn't Fit Space"
            },
            {
              "issueSubTypeCode": "PLACEHOLDER_ISSUE",
              "description": "Placeholder Issue"
            },
            {
              "issueSubTypeCode": "GENERAL_ISSUE",
              "description": "General Issue"
            },
            {
              "issueSubTypeCode": "REVIEW_TRANSLATION",
              "description": "Revieanslation"
            }
          ]
        }
      ]
    }
  }
}

Get Issue States

Currently the only allowed issue states are OPENED and RESOLVED but Smartling may introduce additional states in future. This request returns all current allowed states.

 
gethttps://api.smartling.com/issues-api/v2/dictionary/issue-states
curl --request GET \
  --url https://api.smartling.com/issues-api/v2/dictionary/issue-states
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/issues-api/v2/dictionary/issue-states' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/dictionary/issue-states")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/issues-api/v2/dictionary/issue-states");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/dictionary/issue-states"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "description": "Opened",
          "issueStateCode": "OPENED"
        },
        {
          "description": "Resolved",
          "issueStateCode": "RESOLVED"
        }
      ]
    }
  }
}

Issues

 

Create Issue

Creates a new issue for a string.

Issue text is treated as plain text. Smartling will save the text as provided and will not attempt to render this text with any special formatting in its UIs; it will not be rendered as HTML or markdown. Consumers of the issue API should be aware and escape the text as needed before attempting to render it. Maximum length is 4000 characters.
 
posthttps://api.smartling.com/issues-api/v2/projects/projectId/issues

Path Params

projectId
string
required

Body Params

issueText
string
required

Free text field explaining an issue.

issueTypeCode
string
required

Identifies the issue type. issueTypeCode is either SOURCE or TRANSLATION. Each have their own set of issueSubType values

issueSubTypeCode
string
required

For issueTypeCode=SOURCE - CLARIFICATION | MISSPELLING, For issueTypeCode=TRANSLATION - POOR_TRANSLATION | DOES_NOT_FIT_SPACE | PLACEHOLDER_ISSUE | GENERAL_ISSUE | REVIEW_TRANSLATION

string
object
 
string.hashcode
string
required

Unique identifier for a string in Smartling. Used by the Issues API to attach an issue to a string. You can get the hashcode for a string via String API.

string.localeId
string
required

An identifying code for a language in Smartling.

curl --request POST \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/issues-api/v2/projects/projectId/issues");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "string": {
        "hashcode": "c32c16cddafd63dfa0dc12449372a093",
        "localeId": null
      },
      "resolvedByUserUid": null,
      "reportedByUserUid": "661801f19693",
      "createdDate": "2015-11-10T16:01:22Z",
      "resolvedDate": null,
      "issueText": "asdfsd",
      "issueUid": "dceaa996d417",
      "projectId": "e8fa915fa",
      "issueTypeCode": "SOURCE",
      "issueSubTypeCode": "CLARIFICATION",
      "issueStateCode": "OPENED",
      "issueTextModifiedDate": null
    }
  }
}

Edit Issue

Replaces the text of an issue with new text. Note that only the author of the issue can perform this action. The issueTextModifiedDate property of an issue object shows when it was last updated.

Issue text is treated as plain text. Smartling will save the text as provided and will not attempt to render this text with any special formatting in its UIs; it will not be rendered as HTML or markdown. Consumers of the issue API should be aware and escape the text as needed before attempting to render it. Maximum length is 4000 characters.
 
puthttps://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/issueText

Path Params

projectId
string
required
issueUid
string
required

Body Params

issueText
string
required

Free text field explaining an issue.

curl --request PUT \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/issueText
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/issueText' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/issueText")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/issueText");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/issueText"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "issueText": "Edited issue text.",
      "issueTextModifiedDate": "2015-11-10T16:01:22Z"
    }
  }
}

Open or Close Issue

The state of the issue. Accepted values are OPENED or RESOLVED.

 
puthttps://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/state

Path Params

projectId
string
required
issueUid
string
required

Body Params

issueStateCode
string
required

The state of the issue. Accepted values are OPENED or RESOLVED.

curl --request PUT \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/state
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/state' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/state")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/state");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/state"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "issueStateCode": "RESOLVED"
    }
  }
}

Get Issue Details

Returns detailed information on a single issue. Note that the resolvedByUserUid and reportedByUserUid values are not currently usable for identifying the users who created or resolved issues. In future, a People API will be exposed for looking up user details.

 
gethttps://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid

Path Params

projectId
string
required
issueUid
string
required
curl --request GET \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "string": {
        "hashcode": "c32c16cddafd63dfa0dc12449372a093",
        "localeId": "ru-RU"
      },
      "resolvedByUserUid": null,
      "reportedByUserUid": "661801f19693",
      "createdDate": "2015-11-10T16:01:22Z",
      "resolvedDate": null,
      "issueText": "This translation is incorrect. Please fix.",
      "issueUid": "dceaa996d417",
      "projectId": "e8fa915fa",
      "issueTypeCode": "TRANSLATION",
      "issueSubTypeCode": "POOR_TRANSLATION",
      "issueStateCode": "OPENED",
      "issueTextModifiedDate": null
    }
  }
}

Comments

 

Create Comment

Create a comment for an issue.

Comment text is treated as plain text. Smartling will save the text as provided and will not attempt to render this text with any special formatting in its UIs; it will not be rendered as HTML or markdown. Consumers of the issue API should be aware and escape the text as needed before attempting to render it. Maximum length is 4000 characters.
 
posthttps://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments

Path Params

projectId
string
required
issueUid
string
required

Body Params

commentText
string
required

Text of the comment you want to make.

curl --request POST \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "issueCommentUid": "a75fea779bbb",
      "commentText": "comment text",
      "createdByUserUid": "661801f19693",
      "createdDate": "2015-12-22T12:34:49Z",
      "commentTextModifiedDate": null
    }
  }
}

Get Comments

Returns all comments on an issue. Note that the createdByUserUid value is not currently usable for identifying the users who created comments. In future, a People API will be exposed for looking up user details.

 
gethttps://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments

Path Params

projectId
string
required
issueUid
string
required
curl --request GET \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "items": [
        {
          "issueCommentUid": "a75fea779bbb",
          "commentText": "comment text",
          "createdByUserUid": "661801f19693",
          "createdDate": "2015-12-22T12:34:49Z",
          "commentTextModifiedDate": null
        }
      ],
      "totalCount": 1
    }
  }
}

Edit Comment Text

Replaces the text of an issue with new text. Note that only the author of the issue can perform this action. The commentTextModifiedDate property of an issue object shows when it was last updated.

Comment text is treated as plain text. Smartling will save the text as provided and will not attempt to render this text with any special formatting in its UIs; it will not be rendered as HTML or markdown. Consumers of the issue API should be aware and escape the text as needed before attempting to render it. Maximum length is 4000 characters.
 
posthttps://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid

Path Params

projectId
string
required
issueUid
string
required
issueCommentUid
string
required

Body Params

commentText
string
required

Text of the comment you want to make.

curl --request POST \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "issueCommentUid": "a75fea779bbb",
      "commentText": "comment text",
      "createdByUserUid": "661801f19693",
      "createdDate": "2015-12-22T12:34:49Z",
      "commentTextModifiedDate": "2016-12-22T12:34:49Z"
    }
  }
}

Get Comment Details

Returns detailed information on a single issue comment. Note that the createdByUserUid value is not currently usable for identifying the users who created comments. In future, a People API will be exposed for looking up user details.

 
gethttps://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid

Path Params

projectId
string
required
issueUid
string
required
issueCommentUid
string
required
curl --request GET \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/issueUid/comments/issueCommentUid"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "createdByUserUid": "661801f19693",
      "createdDate": "2015-12-22T11:54:27Z",
      "commentText": "test comment",
      "issueCommentUid": "ac5211a26eca",
      "commentTextModifiedDate": null
    }
  }
}

Find Issues

Returns a list of issues matching specified filter options. You can filter based on the date issues were created, target languages, strings, issue types and states and the user who opened the issue. Unless otherwise specified, request will return a maximum of 30 results. All parameters are optional.

 
posthttps://api.smartling.com/issues-api/v2/projects/projectId/issues/list

Path Params

projectId
string
required

Body Params

createdDateBefore
string
createdDateAfter
string
stringFilter
object
 
stringFilter.hashcodes
array
stringFilter.localeIds
array
limit
integer
offset
integer
reportedByUserUid
string
issueStateCodes
array
issueTypeCodes
array
issueSubTypeCodes
array
curl --request POST \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/list
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/list' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/list")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/list");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/list"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "items": [
        {
          "string": {
            "hashcode": "c32c16cddafd63dfa0dc12449372a093",
            "localeId": "ru-RU"
          },
          "resolvedByUserUid": null,
          "reportedByUserUid": "661801f19693",
          "createdDate": "2015-12-21T16:38:48Z",
          "resolvedDate": null,
          "issueText": "does not fit space",
          "issueUid": "902372ac8e1e",
          "projectId": "e8fa915fa",
          "issueTypeCode": "TRANSLATION",
          "issueSubTypeCode": "DOES_NOT_FIT_SPACE",
          "issueStateCode": "OPENED",
          "issueTextModifiedDate": null
        }
      ],
      "totalCount": 1
    }
  }
}

Count Issues

Returns a count of issues matching specified filter options. You can filter based on the date issues were created, strings, target languages, issue types and states and the user who opened the issue.. All parameters are optional.

 
posthttps://api.smartling.com/issues-api/v2/projects/projectId/issues/count

Path Params

projectId
string
required

Body Params

createdDateBefore
string
createdDateAfter
string
stringFilter
object
 
stringFilter.hashcodes
array
stringFilter.localeIds
array
limit
integer
offset
integer
reportedByUserUid
string
issueStateCodes
array
issueTypeCodes
array
issueSubTypeCodes
array
curl --request POST \
  --url https://api.smartling.com/issues-api/v2/projects/projectId/issues/count
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/issues-api/v2/projects/projectId/issues/count' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/issues-api/v2/projects/projectId/issues/count")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/issues-api/v2/projects/projectId/issues/count");

xhr.send(data);
import requests

url = "https://api.smartling.com/issues-api/v2/projects/projectId/issues/count"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "count": 2
    }
  }
}

Upload

 

Upload a file

Upload original source content to Smartling

Example

  curl -X POST -H "Authorization: Bearer {token}" -F "file=@file.properties;type=text/plain" -F "fileUri=file.properties"  -F "fileType=javaProperties" 'https://api.smartling.com/files-api/v2/projects/{projectId}/file'
 
posthttps://api.smartling.com/files-api/v2/projects/projectId/file

Path Params

projectId
uid
required

Form Data

file
file
required

The file contents to upload

fileUri
string
required

Value that uniquely identifies the uploaded file. This ID can be used to request the file back. We recommend you use file path + file name, similar to how version control systems identify the file. Example: /myproject/i18n/ui.properties

fileType
string
required

Unique identifier for the file type

authorize
boolean

Determines whether content in the file is authorized (available for translation) in all locales upon submitting the file via the Smartling Dashboard. An error message will return if there are insufficient translation funds and authorized is set to true. If a string has been completely excluded for translation from all languages, or excluded from translation for a specific language, authorize will NOT authorize it. Note: to specify a limited list of locales to authorize, use the localeIdsToAuthorize[] parameter

Value Description
true Content will be available for translation in all locales on upload
false Content will be added to the "Awaiting Authorization" queue on upload
localeIdsToAuthorize[]
array of strings

This value, if set, authorizes strings for translation into specific locales. Use the project/locale/list call to get the list of locales for the project or see them in the dashboard on the API settings page. Use multiple localeIdsToAuthorize parameter pairs to authorize more than one locale. You can add languages by uploading the file again and indicating the language to authorize with localeIdsToAuthorize or all languages with authorize, or in the dashboard using the "Show Partially Authorized" filter option from the Awaiting Authorization list. If string has been completely excluded for translation from all languages, or excluded from translation for a specific language, localesIdsToAuthorize will NOT authorize it. Note: Do not set the authorize parameter to TRUE if you want to specify individual locales to authorize. Submitting an upload with both of these parameters set will result in a validation error.

smartling.namespace
string

For accounts created after July 31st 2015 only. Define a custom namespace for the file. This works for Application Resource Files only. For Business Documents, see Update File. Note: while this parameter shares the format of other file directives, it will not work as an inline directive and must be specified in the API call.

smartling.file_charset
string

Specifies a custom charset for text-format files. The value should be the name of the character set. See a full list of supported character sets here.

If this directive is not used, Smartling will use the Content-Type request header to determine if the content is encoded with UTF-16, UTF-16B or UTF-16LE. If there is no Content-Type header, Smartling will examine the file for UTF-16 characters. If none are detected, UTF-8 encoding will be used.

Note: Once this property has been set for a file, it cannot be changed. If you reupload the file, it will use the original charset, even if you change the directive. An error will be returned if this directive is used when uploading binary-format file types, such as Office or IDML files.

smartling.[command]
string

Provides custom parser configuration for supported file types. See Supported File Types for more details.

callbackUrl
url

A GET request that creates a callback to a URL when a file is 100% published for a locale. The callback gives the fileUri and locale with the format http[/s]://your.url?locale=xx-XX&fileUri=your.file. If you upload the file again, without a callbackUrl, it will remove any previous callbackUrl for that file. The RequestBin (http://requestb.in) service is a convenient way to test callback. RequestBin generates a short-lived disposable URL that displays all posted requests.

If a callback fails, Smartling will make multiple attempts to reach the designated URL, however, we do not keep retrying a failed callback indefinitely. Try to make sure your callback URL is as stable as possible and be aware that callbacks are not a 100% reliable way of being notified that a file is published.

curl --request POST \
  --url https://api.smartling.com/files-api/v2/projects/projectId/file
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/file' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/file")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/files-api/v2/projects/projectId/file");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/file"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "overWritten": true,
      "stringCount": 10,
      "wordCount": 2
    }
  }
}
{
  "response": {
    "code": "SUCCESS",
    "data": {
      "message": "Your file was successfully uploaded. Word and string counts are not available right now."
    }
  }
}
{
  "response": {
    "code": "VALIDATION_ERROR",
    "errors": {
      "key": "unknown.field",
      "message": "The field unknown.parameter was not expected. Please consult the documentation to verify the fields you are submitting.",
      "details": "unknown.parameter"
    }
  }
}
{
  "response": {
    "code": "RESOURCE_LOCKED",
    "errors": {
      "key": "resource.locked",
      "message": "The file is currently being processed and will be available in a few minutes."
    }
  }
}
{
  "response": {
    "code": "MAX_OPERATIONS_LIMIT_EXCEEDED",
    "errors": {
      "key": "too.many.requests",
      "message": "The limit of 10 concurrent Smartling file API operations for this project has been exceeded."
    }
  }
}

Download

 

Download original file

Download the original version of the requested file from Smartling

Example

  curl -H "Authorization: Bearer {token}" "https://api.smartling.com/files-api/v2/projects/{projectId}/file?fileUri={your-file-URI}"

It is important to check the HTTP response status code. If Smartling finds and returns the file normally, you will receive a 200 SUCCESS response. If you receive any other response status code than 200, the requested file will not be part of the response.

When you upload a UTF-16 character encoded file, then /file/get requests for that file will have a character encoding of UTF-16. All other uploaded files will return with a character encoding of UTF-8.

You can always use the content-type header in the response of a file/get request to determine the character encoding.

The filename is based on the fileUri associated with the requested file. In most cases, the filename is exactly the fileUri provided. The only exception to this is with .pot gettext files. When a .pot file is specified as the fileUri, Smartling returns a .po file.

 
gethttps://api.smartling.com/files-api/v2/projects/projectId/file

Path Params

projectId
string
required

Query Params

fileUri
string
required

Value that uniquely identifies the downloaded file

curl --request GET \
  --url 'https://api.smartling.com/files-api/v2/projects/projectId/file?fileUri=fileUri'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/file',
  qs: { fileUri: 'fileUri' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/file?fileUri=fileUri")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/file?fileUri=fileUri");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/file"

querystring = {"fileUri":"fileUri"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Download translated file from Smartling

Download the requested file from Smartling

It is important to check the HTTP response status code. If Smartling finds and returns the file normally, you will receive a 200 SUCCESS response. If you receive any other response status code than 200, the requested file will not be part of the response.

When you upload a UTF-16 character encoded file, then /file/get requests for that file will have a character encoding of UTF-16. All other uploaded files will return with a character encoding of UTF-8.

You can always use the content-type header in the response of a file/get request to determine the character encoding.

Example

  curl -H "Authorization: Bearer {token}" "https://api.smartling.com/files-api/v2/projects/{projectId}/locales/{localeId}/file?fileUri={your-file-Uri}"
 
gethttps://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file

Path Params

projectId
string
required
localeId
string
required

Query Params

fileUri
string
required

Value that uniquely identifies the downloaded file

retrievalType
string

Determines the desired format for the download. Applies to translated files only.

retrievalType Description
pending Smartling returns any translations (including non-published translations)
published Smartling returns only published/pre-published translations.
pseudo Smartling returns a modified version of the original text with certain characters transformed and the text expanded. For example, the uploaded string "This is a sample string", will return as "T~hís ~ís á s~ámpl~é str~íñg". Pseudo translations enable you to test how a longer string integrates into your application
contextMatchingInstrumented Smartling returns a modified version of the original file with strings wrapped in a specific set of Unicode symbols that can later be recognized and matched by the Chrome Context Capture Extension
includeOriginalStrings
boolean

Specifies whether Smartling will return the original string or an empty string where no translation is available. This parameter is supported for gettext, java properties, custom XML, and JSON files only

Value Description
true If there is no translation, Smartling returns the original string
false If there is no translation, Smartling returns an empty string
curl --request GET \
  --url 'https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file?fileUri=fileUri'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file',
  qs: { fileUri: 'fileUri' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file?fileUri=fileUri")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file?fileUri=fileUri");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file"

querystring = {"fileUri":"fileUri"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Download translated files from Smartling as a ZIP

Download the requested translated files from Smartling as a ZIP

It is important to check the HTTP response status code. If Smartling finds and returns the file normally, you will receive a 200 SUCCESS response. If you receive any other response status code than 200, the requested files will not be part of the response.

When you upload a UTF-16 character encoded file, then /file/get requests for that file will have a character encoding of UTF-16. All other uploaded files will return with a character encoding of UTF-8.

You can always use the content-type header in the response of a file/get request to determine the character encoding.

Example

  curl -X GET -H "Authorization: Bearer {token}" 'https://api.smartling.com/files-api/v2/projects/{projectId}/files/zip?localeIds[]=de-DE&fileUris[]=yourfile.json'
 
gethttps://api.smartling.com/files-api/v2/projects/projectId/files/zip

Path Params

projectId
string
required

Query Params

fileUris[]
array of strings
required

Smartling Values that each uniquely identify a file

localeIds[]
array of strings
required

List of locales to download

retrievalType
string

Determines the desired format for the download. Applies to translated files only.

retrievalType Description
pending Smartling returns any translations (including non-published translations)
published Smartling returns only published/pre-published translations.
pseudo Smartling returns a modified version of the original text with certain characters transformed and the text expanded. For example, the uploaded string "This is a sample string", will return as "T~hís ~ís á s~ámpl~é str~íñg". Pseudo translations enable you to test how a longer string integrates into your application
contextMatchingInstrumented Smartling returns a modified version of the original file with strings wrapped in a specific set of Unicode symbols that can later be recognized and matched by the Chrome Context Capture Extension
includeOriginalStrings
boolean

Specifies whether Smartling will return the original string or an empty string where no translation is available. This parameter is supported for gettext, java properties, custom XML, and JSON files only

Value Description
true If there is no translation, Smartling returns the original string
false If there is no translation, Smartling returns an empty string
fileNameMode
string

Determines how files in the zip file will be named. If not set, the full original file path will be used as the filename

fileNameMode Description
UNCHANGED Full original file path is used
TRIM_LEADING Remove all except the last path segment. e.g. /en/strings/nav.properties becomes nav.properties
LOCALE_LAST Adds a locale folder to the file path directly before the filename. e.g. /strings/nav.properties becomes /strings/en/nav.properties
localeMode
string

Determines how locales will be handled in the downloaded zip

localeMode Description
LOCALE_IN_PATH Locale code is added to the end of the file path. e.g. /strings/es-ES/nav.properties
LOCALE_IN_NAME Locale code is added to the end of the file name e.g. /strings/nav_es-ES.properties
LOCALE_IN_NAME_AND_PATH Locale code is added to both the path and the filename. e.g. /strings/es-ES/nav_es-ES.properties
zipFileName
string

Name for the downloaded zip file. If unset, default is translations.zip

curl --request GET \
  --url 'https://api.smartling.com/files-api/v2/projects/projectId/files/zip?fileUris%5B%5D=fileUris%5B%5D&localeIds%5B%5D=localeIds%5B%5D'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/files/zip',
  qs: 
   { 'fileUris[]': 'fileUris[]',
     'localeIds[]': 'localeIds[]' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/files/zip?fileUris%5B%5D=fileUris%5B%5D&localeIds%5B%5D=localeIds%5B%5D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/files/zip?fileUris%5B%5D=fileUris%5B%5D&localeIds%5B%5D=localeIds%5B%5D");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/files/zip"

querystring = {"fileUris[]":"fileUris[]","localeIds[]":"localeIds[]"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

List

 

List Files

List recently uploaded files

Returns a maximum of 500 files.

Example

  curl -H "Authorization: Bearer {token}" "https://api.smartling.com/files-api/v2/projects/{projectId}/files/list?fileTypes[]=json&uriMask=strings"
 
gethttps://api.smartling.com/files-api/v2/projects/projectId/files/list

Path Params

projectId
string
required

Query Params

uriMask
string

Return only files with a URI containing the given substring. Case is ignored. For example, the value .json will match strings.json and STRINGS.JSON but not json.strings

fileTypes[]
array of strings
lastUploadedAfter
YYYY-MM-DDThh:mm:ssZ

Return all files uploaded after the specified date

lastUploadedBefore
YYYY-MM-DDThh:mm:ssZ

Return all files uploaded before the specified date

orderBy
string

Sets the name and direction of the parameter to order results by. If ascending or descending is not specified, the default is ascending

limit
integer

See Limit and Offset. In order to get consistent pagination, please make sure to specify the orderBy parameter

offset
integer
curl --request GET \
  --url https://api.smartling.com/files-api/v2/projects/projectId/files/list
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/files/list' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/files/list")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/files/list");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/files/list"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "totalCount": 2,
      "items": [
        {
          "fileUri": "/files/translation_import.csv",
          "created": "2017-09-06T20:29:15Z",
          "lastUploaded": "2017-09-06T20:29:15Z",
          "fileType": "csv",
          "hasInstructions": false
        },
        {
          "fileUri": "/files/4.properties",
          "created": "2017-05-27T12:45:36Z",
          "lastUploaded": "2017-05-27T12:45:36Z",
          "fileType": "javaProperties",
          "hasInstructions": false
        }
      ]
    }
  }
}

List File Types

Return a list of all file types currently represented in the project

 
gethttps://api.smartling.com/files-api/v2/projects/projectId/file-types

Path Params

projectId
string
required
curl --request GET \
  --url https://api.smartling.com/files-api/v2/projects/projectId/file-types
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/file-types' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/file-types")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/file-types");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/file-types"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "items": [
        "csv",
        "javaProperties"
      ]
    }
  }
}

Status

 

Status - All Locales

Return information on a specific file

Example

  curl -X GET -H "Authorization: Bearer {token}" 'https://api.smartling.com/files-api/v2/projects/{projectId}/file/status?fileUri=file.properties'
 
gethttps://api.smartling.com/files-api/v2/projects/projectId/file/status

Path Params

projectId
string
required

Query Params

fileUri
string
required

Smartling value that uniquely identifies a file in Smartling

curl --request GET \
  --url 'https://api.smartling.com/files-api/v2/projects/projectId/file/status?fileUri=fileUri'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/file/status',
  qs: { fileUri: 'fileUri' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/file/status?fileUri=fileUri")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/file/status?fileUri=fileUri");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/file/status"

querystring = {"fileUri":"fileUri"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "fileUri": "/files/test_translation_import.csv",
      "lastUploaded": "2017-09-06T20:29:15Z",
      "created": "2017-09-06T20:29:15Z",
      "fileType": "csv",
      "parserVersion": 4,
      "hasInstructions": false,
      "directives": {
        "file_uri_as_namespace": "true"
      },
      "namespace": {
        "name": "/files/test_trans_import.csv"
      },
      "totalStringCount": 1,
      "totalWordCount": 1,
      "totalCount": 1,
      "items": [
        {
          "localeId": "ru-RU",
          "authorizedStringCount": 0,
          "authorizedWordCount": 0,
          "completedStringCount": 0,
          "completedWordCount": 0,
          "excludedStringCount": 0,
          "excludedWordCount": 0
        }
      ]
    }
  }
}

Status - Single Locale / Extended Response

Return detailed status information on a specific file

Example

  curl -X GET -H "Authorization: Bearer {token}" 'https://api.smartling.com/files-api/v2/projects/{projectId}/locales/{localeId}/file/status?fileUri=file.properties'
 
gethttps://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/status

Path Params

projectId
string
required
localeId
string
required

Query Params

fileUri
string
required

Smartling value that uniquely identifies a file in Smartling

curl --request GET \
  --url 'https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/status?fileUri=fileUri'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/status',
  qs: { fileUri: 'fileUri' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/status?fileUri=fileUri")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/status?fileUri=fileUri");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/status"

querystring = {"fileUri":"fileUri"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "fileUri": "/files/4.properties",
      "lastUploaded": "2017-05-27T12:45:36Z",
      "created": "2017-05-27T12:45:36Z",
      "fileType": "javaProperties",
      "parserVersion": 4,
      "hasInstructions": false,
      "directives": null,
      "namespace": null,
      "totalStringCount": 5,
      "totalWordCount": 9,
      "authorizedStringCount": 4,
      "authorizedWordCount": 5,
      "completedStringCount": 0,
      "completedWordCount": 0,
      "excludedStringCount": 0,
      "excludedWordCount": 0
    }
  }
}

Rename

 

Rename

Rename an uploaded file by changing the fileUri. After renaming the file, the file will only be identified by the new fileUri you provide

Example

  curl -X POST -H "Authorization: Bearer {token}" -F "fileUri=filename.properties" -F "newFileUri=filename2.properties" 'https://api.smartling.com/files-api/v2/projects/{projectId}/file/rename'
 
posthttps://api.smartling.com/files-api/v2/projects/projectId/file/rename

Path Params

projectId
string
required

Form Data

fileUri
string
required

Current value that uniquely identifies the file

newFileUri
string
required

The new value for fileUri. We recommend that you use file path + file name, similar to how version control systems identify the file. Example: /myproject/i18n/ui.properties. This must be a fileUri that does not exist in the current Smartling project.

curl --request POST \
  --url https://api.smartling.com/files-api/v2/projects/projectId/file/rename
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/file/rename' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/file/rename")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/files-api/v2/projects/projectId/file/rename");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/file/rename"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": null
  }
}

Delete

 

Delete

Remove the file from Smartling. The file will no longer be available for download. Any complete translations for the file remain available for use within the system.

Smartling deletes files asynchronously and it typically takes a few minutes to complete. While deleting a file, you can not upload a file with the same fileUri.

Example

  curl -X POST -H "Authorization: Bearer {token}" -F "fileUri=filename.properties" 'https://api.smartling.com/files-api/v2/projects/{projectId}/file/delete'
 
posthttps://api.smartling.com/files-api/v2/projects/projectId/file/delete

Path Params

projectId
string
required

Form Data

fileUri
string
required

Smartling value that uniquely identifies a file in Smartling

curl --request POST \
  --url https://api.smartling.com/files-api/v2/projects/projectId/file/delete
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/file/delete' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/file/delete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.smartling.com/files-api/v2/projects/projectId/file/delete");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/file/delete"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": null
  }
}

Last Modified

 

Last Modified by locale

Return the date a file was last modified in a specified locale

Example

  curl -X GET -H "Authorization: Bearer {token}" 'https://api.smartling.com/files-api/v2/projects/{projectId}/locales/{localeId}/file/last-modified?fileUri=filename.properties'
 
gethttps://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/last-modified

Path Params

projectId
string
required
localeId
string
required

Query Params

fileUri
string
required

Smartling value that uniquely identifies a file in Smartling

lastModifiedAfter
YYYY-MM-DDThh:mm:ssZ

Limits the return to only those file and locale combinations that have a lastModified date after the parameter lastModifiedAfter. The items array will be empty if the file has not been modified in any of the locales since the lastModifiedAfter date specified.

curl --request GET \
  --url 'https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/last-modified?fileUri=fileUri'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/last-modified',
  qs: { fileUri: 'fileUri' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/last-modified?fileUri=fileUri")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/last-modified?fileUri=fileUri");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/locales/localeId/file/last-modified"

querystring = {"fileUri":"fileUri"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "response": {
    "code": "SUCCESS",
    "data": {
      "localeId": "ru-RU",
      "lastModified": "2017-09-06T20:25:18Z"
    }
  }
}

Last Modified - all locales

Return the date a file was last modified in a each locale

Example

  curl -X GET -H "Authorization: Bearer {token}" 'https://api.smartling.com/files-api/v2/projects/{projectId}/file/last-modified?fileUri=filename.properties'
 
gethttps://api.smartling.com/files-api/v2/projects/projectId/file/last-modified

Path Params

projectId
string
required

Query Params

fileUri
string
required

Smartling value that uniquely identifies a file in Smartling

lastModifiedAfter
YYYY-MM-DDThh:mm:ssZ

Limits the return to only those file and locale combinations that have a lastModified date after the parameter lastModifiedAfter. The items array will be empty if the file has not been modified in any of the locales since the lastModifiedAfter date specified.

curl --request GET \
  --url 'https://api.smartling.com/files-api/v2/projects/projectId/file/last-modified?fileUri=fileUri'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.smartling.com/files-api/v2/projects/projectId/file/last-modified',
  qs: { fileUri: 'fileUri' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.smartling.com/files-api/v2/projects/projectId/file/last-modified?fileUri=fileUri")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.smartling.com/files-api/v2/projects/projectId/file/last-modified?fileUri=fileUri");

xhr.send(data);
import requests

url = "https://api.smartling.com/files-api/v2/projects/projectId/file/last-modified"

querystring = {"fileUri":"fileUri"}

response = requests.request("GET", url, params=querystring)

print(response.text)