Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k points)

 have the following problem:

In Workfusion Studio I have created a new bot task and have defined 2 vars:

<var-def name="tJSON">

  [{'Text':'ciao'}]

</var-def>

<var-def name="tLanguage">

        <http-extended url="https://api.cognitive.microsofttranslator.com/translate?api-version=3.0" method="POST" charset="UTF-8" content-type="application/json">

            <http-header-extended name="Ocp-Apim-Subscription-Key">83ffa3bd24bf4f75aa0814c3713bd0d4</http-header-extended>

            <http-param-extended name="to">en</http-param-extended>

             <var name="tJSON"/>

        </http-extended>    

</var-def>

 have the following response:

{"error":{"code":400036,"message":"The To field is required."}}

What is wrong with the http-param-extended in my definition, please, advice!

1 Answer

0 votes
by (29.5k points)

The API requires the 'to' parameter to be present in URL, rather than in the request body.
Can be done as follows:

<http-extended url="https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&amp;to=en" .

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...