Create a Translation

Endpoint URL: {identityDomain} /config/{appId} /flows/{flow} /translations



Description

Adds new translation strings to the translations dictionary. You must supply a list of values for each locale defined in the flow. For a list of locales, call /config/{app}/flows/{flow}/locales.


Respects the API Client Allow List:  No

API Client Permissions

The following table indicates the API clients that can (and the API clients that can't) be used to call this endpoint:

owner
access_issuer
direct_access
direct_read_access
login_client
Yes
No
Yes
No
No


Authentication

This endpoint supports Basic authentication. 

How to Create an Authentication String


Base URL

The base URL for this endpoint is your Configuration API domain followed by /config/ followed by your application ID. For example, if you are in the US region and your application ID is htb8fuhxnf8e38jrzub3c7pfrr, then your base URL would be:


https://v1.api.us.janrain.com/config/htb8fuhxnf8e38jrzub3c7pfrr

Allowed regions are:

  • us 
  • eu 
  • au 
  • sa 
  • cn
  • sg


Request Example (application/json)


[
  {
    "values": {
      "en-US": "Hello!",
      "fr-FR": "Bonjour!",
      "it-IT": "Bongiorno!"
    }
  },
  {
    "values": {
      "en-US": "Goodbye!",
      "fr-FR": "Au revoir!",
      "it-IT": "Arrivederci!"
    }
  }
]


Request Example (text/csv)

en-US,it-IT
Hello!,Bongiorno!
Goodbye,Arrivederci!


Sample Request 1 (curl)

This command adds a new translation to the documentation flow by using a set of JSON formatted valyes.


curl -X POST \
https://v1.api.us.janrain.com/config/hevwjvt8j7cym5hbbzdu8mv6aj/flows/documentation/translations \
  -H 'Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg=' \
  -H 'Content-Type: application/json' \
  -d '[
        {
           "values": {
             "it-IT": "Nome utente o password errati. Per favore riprova.",
             "en-US": "Incorrect username or password. Please try again.",
             "fr-FR": "Identifiant ou mot de passe incorrect. Veuillez réessayer."
        }
     }
  ]'


Sample Request 2 (curl)

This second example uses a comma-separated set of values to a new translation to the documentation flow.

curl -X PATCH \
  https://v1.api.us.janrain.com/config/hevwjvt8j7cym5hbbzdu8mv6aj/flows/documentation/translations \
  -H 'Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg' \
  -H 'Content-Type: text/csv' \
  -d 'path,key,en-US,it-IT,fr-FR
  fields.photoManager.customText.removePhotoCantBeUndoneText,b29cdf6b705b9d459b9cba8076250a2b,This cannot be undone.,Questo non può essere annullato.,Ça ne peut pas être annulé.'


Responses

201 Created

Returns a partial rendering of the affected locales.

Response Headers

Content-Location (string)

The location of the full translation dictionaries.

Example: Content-Location: /config/v86cchggr5cdvbfh7ydk8s63zz/flows/myCoolFlow/translations

Response Example (application/json)


{
  "_self": "/config/4qeam8586cpkuru3ju8kj2xwdf/flows/myCoolFlow/translations",
  "translations": [
    {
      "_self": "/config/4qeam8586cpkuru3ju8kj2xwdf/flows/myCoolFlow/translations/5ac7ea6d-48b8-46d5-abed-ac3b6b12268f",
      "path": "",
      "values": {
        "it-IT": "Arrivederci!",
        "en-US": "Goodbye!",
        "fr-FR": "Au revoir!"
      },
      "key": "5ac7ea6d-48b8-46d5-abed-ac3b6b12268f"
    },
    {
      "_self": "/config/4qeam8586cpkuru3ju8kj2xwdf/flows/myCoolFlow/translations/6bdb687e-3d9f-4018-be6b-613011ad8b70",
      "path": "",
      "values": {
        "it-IT": "Bongiorno!",
        "en-US": "Hello!",
        "fr-FR": "Bonjour!"
      },
      "key": "6bdb687e-3d9f-4018-be6b-613011ad8b70"
    }
  ]
}

404 Not Found

Flow could not be found. Please check the value and try again.

Response Example (application/json)


{
  "errors": "Flow not found."
}