Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Latest commit

 

History

History
73 lines (57 loc) · 1.69 KB

README.md

File metadata and controls

73 lines (57 loc) · 1.69 KB

Access Amazon Translate via HTTP API.

setup

microservice

  1. Download this package as .zip.
  2. Create a new lambda function on AWS Lambda.
  3. In Function Code, select Code entry type as .zip.
  4. Select Add triggers , API Gateway.
  5. In API, select Create a new API.
  6. For Security, select Open.
  7. Select Add, and Save.
  8. Copy the API endpoint URL.

test

  1. Install RestMan extension for using HTTP API.
  2. For Enter url here..., paste API endpoint URL.
  3. API data is sent through Body -> RAW.

usage

{
  "method": "translateText",
  "params": {
    "Text": "I like milk.",
    "SourceLanguageCode": "auto",
    "TargetLanguageCode": "es"
  }
}
// {
//     "data": {
//         "TranslatedText": "me gusta la leche,",
//         "SourceLanguageCode": "en",
//         "TargetLanguageCode": "es"
//     }
// }


{
  "method": "translateText",
  "params": {
    "Text": "I like milk.",
    "TargetLanguageCode": "es"
  }
}
// {
//     "err": {
//         "message": "Missing required key 'SourceLanguageCode' in params",
//         "code": "MissingRequiredParameter",
//         "time": "2019-01-05T10:48:59.718Z"
//     }
// }

serverlessf

References: AWS Translate SDK.