Translate Documents with SAP API Business Hub
Use your SAP BTP account to translate documents with SAP API Business Hub.
Overview
You will learn
- How to get started with SAP API Business Hub
- How to maintain the Document Translation credentials in SAP API Business Hub
- How to translate a Document in SAP API Business Hub
Prerequisites
Prerequisites
- You have created a Free Tier account on SAP Business Technology Platform: Get an Account on SAP BTP to Try Out Free Tier Service Plans or you have your own SAP BTP Enterprise Account.
- You have created the credentials for Document Translation, as described in Create Service Instance for Document Translation.
- You want to translate a document that is not larger than 5 MB because this is the limit for the SAP API Business Hub and contains less than 40.000 characters (document translation API restriction for synchronous API).
Steps
Follow the link to the SAP API Business Hub.

The SAP API Business Hub offers a test facility for APIs. In order to take advantage of this, you need to log on.
Select Login at the top of the page.

Search for document translation to find the Document Translation API and select the Document Translation API.

The Document Translation API Reference page shows the two available APIs.

Take a minute to explore both APIs.
The service offers a sandbox system out of the box, but the idea of this tutorial is to show, how to connect your SAP BTP free tier or enterprise account to the SAP API Business Hub.
Select the Try Out button.

Configure Click Environment: Sandbox to open the menu and select + Add New Environment

Configure In the Configure Environment screen, enter a display name for the environment:
myaccountand select the Starting URL corresponding to the region of your SAP BTP account.
Configure For client ID and client secret, take the information from the Document Translation credentials as described in Create Service Instance for Document Translation

Configure For subaccount, take the subdomain information from your SAP Business Technology Platform cockpit. For example, on the screen-shot below, the sub-account is
80c353f5trial.
Configure Enter your value in SAP Business API Hub.

Configure Save your settings for future sessions.

Configure
Now that your API environment is maintained, you will see the myaccount entry.
Select Synchronous document translation and POST /translation.

You can maintain the languages in the Parameters section. Source and Target Language fields are already pre-filled with values for English and German. If you want to try out other language codes, please refer to the available language information here.

Go to the Body section and select Form Data.
Choose File to select a document from your file source system (Microsoft Word, Microsoft PowerPoint, Microsoft Excel or other file formats which are mentioned here) and click Run.

After some seconds you will see in the Response Body section a Download file link. Click the link and the translated file will be downloaded.

Open the file and verify the translation result.

Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.