Could some one help me on how to leverage the Get node to connect to an API. This was from the API documentation.
curl -X POST ‘https://api-free.deepl.com/v2/translate’
-H ‘Authorization: DeepL-Auth-Key [yourAuthKey]’
-d ‘text=Mir%20ist%20kalt’
-d ‘source_lang=DE’
-d ‘target_lang=EN-GB’
However how do I translate this and enter this as a single URL into the get node
The API also offers a HTTP request
POST /v2/translate HTTP/2
Host: api-free.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 54
Content-Type: application/json
text=Mir%20ist%20kalt&source_lang=DE&target_lang=EN-GB. But this also I am not sure how I should enter this into the “Get” node. Thank you in advance for helping out.
Ok I did some digging and now pivoted to a POST request node. Here are some screenshots I added on how I added the data. New cuRL node is
curl -X POST ‘https://api-free.deepl.com/v2/translate’
–header ‘Authorization: DeepL-Auth-Key [yourAuthKey]’
–header ‘Content-Type: application/json’
–data ‘{
“text”: [
“Hello, world!”
],
“target_lang”: “DE”
}’
However I am still unsuccessful as the error message are two folds:
Hi @justmattam,
Out of curiosity… have you already tried the free DeepL Nodes? For your use case, the Translate Text node might be exactly what you are looking for.
Best regards,
Daniel
2 Likes
In your POST request, you only have filled in application
instead of application/json

2 Likes
Thank you Daniel for highlighting. I was not aware but this is a viable alternative.
1 Like
Thanks Arjex. You are right. I also misspelled the Authorization key. Are you aware if a “get” node could be used instead of the post node in the scenario that I was using?
@justmattam You are welcome! The good news is… I built the nodes together with @qqilihq. So if you decide to try them and run into any problems, just let use know here on the forum or at mail@nodepit.com.
Best regards,
Daniel