Skip to Content

Use the Machine Translation API from a REST Client

0 %
Use the Machine Translation API from a REST Client

Use the Machine Translation API from a REST Client

Discover how to call the Machine Translation API from a REST Client like Postman

You will learn

  • Call an API from a REST client like Postman
  • The basics about Machine Learning Foundation Service for Machine Translation

Note: This service was in alpha version when this tutorial was released.

Step 1: The Machine Translation Service

The Machine Translation service enables you to translate texts into a range of languages.

This service is powered by SAP Translation Hub and is trained on SAP-related content to provide accurate domain adaptation and terminology coverage.

The service execution requires the following details provided using the request body in a JSON format:
- the source language
- the target languages (one or more)
- a series of input texts with an associated key identifier

The service will return a JSON response that includes the original input text with the associated translations.

For more details, you can check the following link:

Log on to answer question
Step 2: Call the API

Open a new tab in Postman.

Make sure that the my-ml-foundation environment is selected.

On the Authorization tab, select Bearer Token, then enter {{OAuthToken}} as value.


Note:: the OAuthToken environment variable can be retrieved following the Get your OAuth Access Token using a REST Client tutorial.

Fill in the following additional information:

Field Name Value
URL the value for TRANSLATION_URL in your service key

Note As a reminder, the URL depends on you Cloud Platform landscape region but for the trial landscape only Europe (Frankfurt) provide access to the Machine Learning Foundation services.

On the Body tab, select raw then select JSON (application/json) instead of Text.

And in the body area paste the following content:

  "sourceLanguage": "de",
  "targetLanguages": [
  "units": [
      "value": "Ich möchte meine Verkaufsdaten analysieren.",
      "key": "ANALYZE_SALES_DATA"
      "value": "Ich möchte einen Bericht mit meinen vierteljährlichen Umsatzdaten erstellen",

This will translate the 2 units in English from German.


Click on Send.

You should receive a response that includes a series of faces entries:

    "value": "Ich möchte meine Verkaufsdaten analysieren.",
    "key": "ANALYZE_SALES_DATA",
    "translations": [
            "language": "en",
            "value": "I want to analyze my sales data."
Log on to answer question
Step 3: Validate your results

Provide an answer to the question below then click on Validate.

Paste the full response returned with the previous test.

Next Steps

Back to top