user3782645
user3782645

Reputation:

http-param-extended does not work in RPA Express

I 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>

I have the following response:

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

I have tested the following api via Restlet Client on Chrome:

enter image description here

enter image description here

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

Upvotes: 0

Views: 271

Answers (1)

Andrey
Andrey

Reputation: 6786

Apparently the API requires the to parameter to be present in URL, rather than in the request body.

Can be done as following:

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

Upvotes: 0

Related Questions