According to the Rest/Json documentation, what you are willing to do is not supported.
QueryOQL can returned a combinaison of objects from different classes while the REST API only propose to search objects from a single class (might be an abstract class, resulting in objects from multiple final classes, but limited to fields of the abstract class).
I have not tested what would be the result of an API search like this:
{
"operation": "core/get",
"class": "Person",
"key": "SELECT Team, Person FROM Team JOIN lnkPersonToTeam AS l ON l.team_id=Team.id JOIN Person ON l.person_id=Person.id WHERE email LIKE '%.com'",
"output_fields": "Person.friendlyname, Team.email"
}
You can try. If it does not work, then no solution.
Also if your QueryOQL is only getting one class of object, then it's always possible to get the results, you need to parse the OQL to get the class name, as it's not an attribute, then use the above search, with class (=unique class requested by the QueryOQL) and key (=the content of the OQL).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
this will get me the name and expression of OQL #6
{
"operation": "core/get",
"class": "QueryOQL",
"key": 6,
"output_fields": "friendlyname, oql
}
I want to run the OQL via the REST API. Does anyone have a solution?
correction. I want to run the OQL by its ID via REST/JSON
According to the Rest/Json documentation, what you are willing to do is not supported.
QueryOQL can returned a combinaison of objects from different classes while the REST API only propose to search objects from a single class (might be an abstract class, resulting in objects from multiple final classes, but limited to fields of the abstract class).
I have not tested what would be the result of an API search like this:
You can try. If it does not work, then no solution.
Also if your QueryOQL is only getting one class of object, then it's always possible to get the results, you need to parse the OQL to get the class name, as it's not an attribute, then use the above search, with class (=unique class requested by the QueryOQL) and key (=the content of the OQL).