I am attempting to bring JSON data into Google Sheets using a Wikidata API.
However, one of the symbols utilized in this API is the vertical bar: |. It serves as an "and". For instance, if I wish to import data in BOTH English and Greek, then I need to use the "|".
Example API URL: https://www.wikidata.org/w/api.php?action=wbgetentities&props=labels&languages=en|el&format=json&ids=Q192151
https://i.sstatic.net/r4wQj.png
Note the usage of "|" in the API URL between "en" and "el".
I am using a customized function called importJSON which can be located here
When I paste the API URL WITH the "| to fetch the JSON data to my Google sheet, I encounter an error:
https://i.sstatic.net/2Vda1.png
The error points to line 139 in the script:
var jsondata = UrlFetchApp.fetch(url);
HOWEVER, when I OMIT the "|", the API URL works smoothly:
https://i.sstatic.net/XYAS1.png
How can I successfully import the JSON data from the API WITH THE "|"?
I have limited knowledge in coding, so could someone modify the custom script I provided above or advise me on what needs to be added to the script for it to function correctly?