Thanks for reaching out to us here. Seems like the way you are passing your request is not correct, please check below code sample which I just tested and worked.
import requests, uuid, json
# Add your subscription key and endpoint
subscription_key = "replace_your_key"
endpoint = "https://api.cognitive.microsofttranslator.com"
# Add your location, also known as region. The default is global.
# This is required if using a Cognitive Services resource.
location = "global"
path = '/translate'
constructed_url = endpoint + path
params = {
'api-version': '3.0',
'from': 'en',
'to': ['de', 'it']
}
constructed_url = endpoint + path
headers = {
'Ocp-Apim-Subscription-Key': subscription_key,
'Ocp-Apim-Subscription-Region': location,
'Content-type': 'application/json',
'X-ClientTraceId': str(uuid.uuid4())
}
# You can pass more than one object in body.
body = [{
'text': 'Hello World!'
}]
request = requests.post(constructed_url, params=params, headers=headers, json=body)
response = request.json()
print(json.dumps(response, sort_keys=True, ensure_ascii=False, indent=4, separators=(',', ': ')))
Hope this helps.
Regards,
Yutong
@ReMiKU
I think this is something related to the setting of n8n, I will highly recommend you to post this question in n8n community since we are not so familiar of how to set things correct in third part.
This is something I got from internet resource: https://community.n8n.io/t/http-auth-letterexpress/1049
n8n document about Microsoft: https://docs.n8n.io/credentials/microsoft/
I am so sorry can not help you figure out third part issue, but I hope the forum and document helps.
Regards,
Yutong
@YutongTie-MSFT
Sorry for the late reply I took a break from it for a couple of days frustrated but I'm back now. Thanks for the reference, I will try to inquire over at the n8n community although I was quite positive its on Microsoft end since I've tried all n8n settings :L