Translate Documents with SAP API Business Hub
- 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
- 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).
- Step 1
- Step 2
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.
- Step 3
document translationto find the Document Translation API and select the Document Translation API.
- Step 4
The Document Translation API Reference page shows the two available APIs.
Take a minute to explore both APIs.
- Step 5
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.
Click Environment: Sandbox to open the menu and select + Add New Environment
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.
For client ID and client secret, take the information from the Document Translation credentials as described in Create Service Instance for Document Translation
For subaccount, take the subdomain information from your SAP Business Technology Platform cockpit. For example, on the screen-shot below, the sub-account is
Enter your value in SAP Business API Hub.
Save your settings for future sessions.
- Step 6
Now that your API environment is maintained, you will see the
Select Synchronous document translation and POST /translation.
- Step 7
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.
- Step 8
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.
- Step 9
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.
Where do you enter the credentials for Document Translation?