Translate input on click of a button

Is it possible to translate input field to another field? From language x to language y in next input field, lets say when user clicks button translate.

Input - x [Translate to y button]
Input - y

and

Input - y [Translate to x button]
Input - x

When translate button is clicked make API request to DeepL API and put the result in the translation box


I get:
Raw response from the API
Status code 403
Forbidden

  • when initalizing call

Because you haven’t put in the API key correctly. The API docs show that the key should be DeepL-Auth-Key [yourAuthKey] and you don’t have the DeepL-Auth-Key prefix. And you also have no content in the API request…


The content in the red box should be your API request body