I am trying to import JSON data to google sheets using a wikidata API.
However, one of the symbols that are used in this api is the vertical bar: | . It is used as an "and" . For example if I want to import data in BOTH english and greek, then I have to use the " | ".
Example API url: https://www.wikidata.org/w/api.php?action=wbgetentities&props=labels&languages=en|el&format=json&ids=Q192151
Notice the use of the | on the api url between en and el.
I use a custom function named importJSON that can be found here
When i paste the api url WITH the | to import the json data to my google sheet, I get an error:
The error says that is on the line 139 which is this in the script:
var jsondata = UrlFetchApp.fetch(url);
BUT if I DONT contain the " | " in the api url, it works fine:
How can I import the JSON data from the api WITH THE " | " ?
I don't know much from coding so if someone could modify the custom script i linked above, or tell me what should I add to the script to make it work?