Issues with JSON Formatting for Google Translate API

Hello,
I'm working on translator app and integrating the Google Translate API. I've built the following blocks:

  1. I'm using a Web Component (WebTranslator) to send requests to the Google Translate API
  2. The JSON body for the API requets
  3. I'm using the following URL: https://translation.googleapis.com/language/translate/v2?key=
  4. Header= Content-Type: application/json

Issue: I keep receiving the following error

Can somebody help me, what is the problem?



Errors in your JSON

Use Do it to display your JSON string...

Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

You also can check for valid JSON here

Taifun

Or build your json with dictionary blocks:

2 Likes