Access Amazon Translate via HTTP API.
setup
microservice
- Download this package as .zip.
- Create a new lambda function on AWS Lambda.
- In Function Code, select Code entry type as
.zip
. - Select Add triggers ,
API Gateway
. - In API, select
Create a new API
. - For Security, select
Open
. - Select
Add
, and Save
. - Copy the API endpoint URL.
test
- Install RestMan extension for using HTTP API.
- For Enter url here..., paste API endpoint URL.
- API data is sent through Body -> RAW.
usage
{
"method": "translateText",
"params": {
"Text": "I like milk.",
"SourceLanguageCode": "auto",
"TargetLanguageCode": "es"
}
}
{
"method": "translateText",
"params": {
"Text": "I like milk.",
"TargetLanguageCode": "es"
}
}
References: AWS Translate SDK.