/config/{app}/flows/{flow}/translations

This endpoint includes the following methods:


GET

Returns a dictionary of all translations. See a video demo in Postman here.

Authentication

This endpoint supports Basic authentication. To create an authentication string, combine your API client ID, a colon (:), and your client secret into a single value. For example, if your client ID is abcdefg and your client secret is hijklmnop, that value would look like this:

abcdefg:hijklmnop

Next, take the string and base64 encode it.

For example, on a Mac, you can base encode the string using this command:

echo -n "abcdefg:hijklmnop" | base64

If you’re running Microsoft Windows, you can encode the string by using a Windows PowerShell command similar to this:

[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("abcdefg:hijklmn"))

The resulting value (e.g., YWJjZGVmZzpoaWprbG1ub3A=) should be used in your authentication header.

If you are making API calls using Postman, select Basic Auth as your identification type, then use the client ID as the username and the client secret as the password.

Make sure that your API client has the all the permissions (for example, the right to read user profile information) needed to complete the API call.

Base URL

The base URL for this endpoint is your Janrain 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

Request Headers

Parameter Type Required Description
Accept string Indicates the format for the returned data. Allowed values are:
  • application/json
  • text/csv

Sample Request (curl)

This command returns information about all the translations associated with the documentation flow:


curl -X GET \
  https://v1.api.us.janrain.com/config/htb8fuhxnf8e38jrzub3c7pfrr/flows/documentation/translations \
  -H 'Authorization: Basic aW1fYV...NfbXk=' \
  -H 'Content-Type: application/json' 

Running Code Samples Using Postman

The Janrain REST API code samples are written using Curl, but they can easily be run from within Postman. To use one of our code samples in Postman:

  1. Click the Copy to Clipboard button located directly beneath the code sample
  2. In Postman, click Import to display the Import dialog box.
  3. In the Import dialog box, click Paste Raw Text, and then paste in the copied code. The Import dialog box should look similar to this:

  4. Click Import, and the Curl command will be converted to a format that can be run from within Postman. All you need to do now is configure the command to work with your Janrain implementation.

Responses

200 OK

Response Example (application/json)


[
  {
    "_self": "/config/v86cchggr5cdvbfh7ydk8s63zz/flows/myCoolFlow/translations/991a5781-cbe1-4770-bbf1-395168a11d59",
    "key": "991a5781-cbe1-4770-bbf1-395168a11d59",
    "path": "fields.someField.label",
    "values": {
      "en-US": "Register",
      "fr-FR": "Faire inscrire",
      "it-IT": "Registrati"
    }
  },
  {
    "_self": "/config/v86cchggr5cdvbfh7ydk8s63zz/flows/myCoolFlow/translations/1ab1f15d-2555-49af-bd88-cf984ad40a13",
    "key": "1ab1f15d-2555-49af-bd88-cf984ad40a13",
    "path": "fields.anotherField.label",
    "values": {
      "en-US": "Hello!",
      "fr-FR": "Bonjour!",
      "it-IT": "Bongiorno!"
    }
  },
  {
    "_self": "/config/v86cchggr5cdvbfh7ydk8s63zz/flows/myCoolFlow/translations/a8670648-f9f7-4c0b-92cd-e477fe67b617",
    "key": "a8670648-f9f7-4c0b-92cd-e477fe67b617",
    "path": "fields.oneMoreField.label",
    "values": {
      "en-US": "Goodbye!",
      "fr-FR": "Au revoir!",
      "it-IT": "Arrivederci!"
    }
  }
]

Response Example (text/csv)

path,key,en-US,it-IT,fr-FR
fields.someField.label,991a5781-cbe1-4770-bbf1-395168a11d59,Register,Registrati,Faire inscrire
fields.anotherField.label,1ab1f15d-2555-49af-bd88-cf984ad40a13,Hello!,Bongiorno!,Bonjour!
fields.oneMoreField.label,a8670648-f9f7-4c0b-92cd-e477fe67b617,Goodbye,Arrivederci!,Au revoir!

404 Not Found

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

Response Example (application/json)


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


PATCH

Description

Updates existing translations. This endpoint does not delete data. See the video demo in Postman here.

Authentication

This endpoint supports Basic authentication. To create an authentication string, combine your API client ID, a colon (:), and your client secret into a single value. For example, if your client ID is abcdefg and your client secret is hijklmnop, that value would look like this:

abcdefg:hijklmnop

Next, take the string and base64 encode it.

For example, on a Mac, you can base encode the string using this command:

echo -n "abcdefg:hijklmnop" | base64

If you’re running Microsoft Windows, you can encode the string by using a Windows PowerShell command similar to this:

[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("abcdefg:hijklmn"))

The resulting value (e.g., YWJjZGVmZzpoaWprbG1ub3A=) should be used in your authentication header.

If you are making API calls using Postman, select Basic Auth as your identification type, then use the client ID as the username and the client secret as the password.

Make sure that your API client has the all the permissions (for example, the right to read user profile information) needed to complete the API call.

Base URL

The base URL for this endpoint is your Janrain 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

Request Example (application/json)


[
  {
    "key": "a8670648-f9f7-4c0b-92cd-e477fe67b617",
    "values": {
      "en-US": "See ya!"
    }
  }
]

Request Example (text/csv)

key,en-US
a8670648-f9f7-4c0b-92cd-e477fe67b617,See ya!

Sample Request (curl)

This command updates the values assigned to the documentation flow translation key afeba216c561f421e6e19e6cfed3acd8:


curl -X PATCH \
  https://v1.api.us.janrain.com/config/htb8fuhxnf8e38jrzub3c7pfrr/flows/documentation/translations \
  -H 'Authorization: Basic dXQ0YmdycmE3dzI4MmpjZm15cGZxeDlwemhxaGpqMmI6eXk4MmhxdXhnbWt6bWMzcGRoZ3VmdDNwNHluc3R6cjU=' \
  -H 'Content-Type: application/json' \
  -d '[
	{
		"key": "afeba216c561f421e6e19e6cfed3acd8",
        "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."
        }
	}
]'

Running Code Samples Using Postman

The Janrain REST API code samples are written using Curl, but they can easily be run from within Postman. To use one of our code samples in Postman:

  1. Click the Copy to Clipboard button located directly beneath the code sample
  2. In Postman, click Import to display the Import dialog box.
  3. In the Import dialog box, click Paste Raw Text, and then paste in the copied code. The Import dialog box should look similar to this:

  4. Click Import, and the Curl command will be converted to a format that can be run from within Postman. All you need to do now is configure the command to work with your Janrain implementation.

Responses

204 No Content

Successfully updated the translations.

404 Not Found

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

Response Example (application/json)


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


POST

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.

Authentication

This endpoint supports Basic authentication. To create an authentication string, combine your API client ID, a colon (:), and your client secret into a single value. For example, if your client ID is abcdefg and your client secret is hijklmnop, that value would look like this:

abcdefg:hijklmnop

Next, take the string and base64 encode it.

For example, on a Mac, you can base encode the string using this command:

echo -n "abcdefg:hijklmnop" | base64

If you’re running Microsoft Windows, you can encode the string by using a Windows PowerShell command similar to this:

[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("abcdefg:hijklmn"))

The resulting value (e.g., YWJjZGVmZzpoaWprbG1ub3A=) should be used in your authentication header.

If you are making API calls using Postman, select Basic Auth as your identification type, then use the client ID as the username and the client secret as the password.

Make sure that your API client has the all the permissions (for example, the right to read user profile information) needed to complete the API call.

Base URL

The base URL for this endpoint is your Janrain 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

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!

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."
}