Problem creating a connector with an array in json

I'm creating a connector for deepl.com

This is the JSON notation included in RequestBody:

          {
            "jsonrpc": "2.0",
            "method": "LMT_handle_jobs",
            "params": {
              "jobs": [{
                "kind": "default",
                "raw_en_sentence": "@Model.Text"
              }],
              "lang": {
                "source_lang_user_selected": "@ModelFrom",
                "target_lang": "@ModelTo"
              },
              "priority": -1
            }
          }

Executing the connector produces an exception (failed to compile).

Is there a problem with the arrays in JSON?

Can you attach the xml file with your JsonPaths?

Hello, I have made progress with the connector for the deepl translator.

I already get the translation back, but I have a problem when the text to be translated contains double quotes. A "Parse error" exception occurs with the message "Insert values failed".

How can I process it?

Thank you.

Please copy the relevant part of the Json array.

<Fetch Url="https://www.deepl.com/jsonrpc">
  <HttpSettings>
    <RequestHeaders>
      <Header Name='User-Agent'>SeoToolsForExcel</Header>
    </RequestHeaders>
    <RequestMethod>POST</RequestMethod>
    <RequestContentType>application/json</RequestContentType>
    <RequestBody>
      {
        "jsonrpc": "2.0",
        "method": "LMT_handle_jobs",
        "params": {
          "jobs": [{
            "kind": "default",
            "raw_en_sentence": "@Model.Text"
          }],
          "lang": {
            "source_lang_user_selected": "@Model.From",
            "target_lang": "@Model.To"
          },
          "priority": -1
        }
      }
    </RequestBody>
  </HttpSettings>
</Fetch>
<Fail>
  <JsonPath Expr="error.message"/>
</Fail>
<Parse>
  <JsonPath Expr="result.translations[0].beams[0].postprocessed_sentence" Converter="String" />
</Parse>

Thank you. I misunderstood your question.

Can you try the Compute function? See below, you can alter the inputs and perhaps remove the double quotes?

Thanks,

the problem is not in the response..

Occurs when sending the original string with the double quotes embedded in the JSON.

The quotation marks should be encoded as " or \u0022 so that it works.

But I do not know how to do it.

Can you try """ or just double quotes instead of single quote?

I have sent a pull request to the connectors repository in github.

Nice, I added a function which removes the quotes. Are you satisfied with this solution?

Yes, but I added support for quotes :wink:

Thank you very much. Do you know if Deepl has any API restrictions?

At the moment it is an unofficial API and is not documented, so no possible restrictions are known. But they do plan to launch the official: https://www.deepl.com/press.html