I have a need to search for tickets based on ref-no with "LIKE" conditions.
If the query is executed in Run Queries on iTop, then the query is executed successfully. But if the query is executed in Rest / JSON, it will get an error with the message "Error: Parameter json_data is not a valid JSON structure".
After I searched, it turned out that there was a problem with the percent of characters in the like condition. Because if I remove the like condition part, the query can be run in Rest / JSON. But if I try to use JSON Formatter like "Json Formatter", my json is valid.
I have a need to search for tickets based on ref-no with "LIKE" conditions.
If the query is executed in Run Queries on iTop, then the query is executed successfully. But if the query is executed in Rest / JSON, it will get an error with the message "Error: Parameter json_data is not a valid JSON structure".
After I searched, it turned out that there was a problem with the percent of characters in the like condition. Because if I remove the like condition part, the query can be run in Rest / JSON. But if I try to use JSON Formatter like "Json Formatter", my json is valid.
How to fix this problem?
Thanks before.
I'm assuming the problem lies in the HTTP request; where % is sometimes used for hex encoding. For instance, %20 is a space.
So before sending the request, I think you'll need to do proper encoding for the % character.
Just a guess :)