// Get translate result using queue ID
func GetApiExample(accessKey, secretKey, basePath, nonce string) {
path := "/api/v1/translate/async"
// Generate a signature
sign := MakeHMAC(nonce, path, secretKey)
// Set headers and call the api
client := &http.Client{}
req, _ := http.NewRequest("GET", GetFullUrl(basePath, path), nil)
req.Header.Set("nonce", nonce)
req.Header.Set("accessKey", accessKey)
req.Header.Set("signature", sign)
res, err := client.Do(req)
// Output response
if err != nil {
fmt.Printf("The HTTP request failed with error %s\n", err)
} else {
data, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(data))
}
}