Hi snaveen
I think the JSON body of our request will look something like the following. Note that I removed the * from SELECT *. We recommend against using SELECT * as much as possible in LiQL queries (particularly for the Messages collection because a Message object is quite large) and instead be as specific as possible in the SELECT statement. While a query with * might technically return data, * is not officially supported in the SELECT statement.
Also, notice that I added both a LIMIT for both queries and I added a SORT option for the query to the Messages collection (also a best practice). See the Best Practices section of Using LiQL for more performance tips.
[
{
"floated_messages":{
"fields":[
"id",
"href",
"message",
"scope",
"user"
],
"constraints":[
{
"message.board.id":"VxRail"
},
{
"scope":{
"matches":"global"
}
}
],
"limit":5
}
},
{
"messages":{
"fields":[
"id",
"view_href",
"href"
],
"constraints":[
{
"board.id":"VxRail"
},
{
"id":{
"matches":"8122626"
}
}
],
"sorts":[
"post_time desc"
],
"limit":5
}
}
]
To build the JSON body for the request, I copied the format from the Request body format for JSON-based queries section of the Community API v2 request guide and basically filled in the <field>, <collection>, and <sort> placeholders with the related fields, constraints, and sorts in the LIQL queries you posted.
A cURL example would look something like this using Session Key authentication. If you're using OAuth, then you'd use the client-id and Authorization headers (described in the Headers section of the guide I mentioned above) instead of the li-api-session-key header.
curl -L -X POST 'https://[COMMUNITY DOMAIN]/api/2.0/search' \
-H 'li-api-session-key: [SESSION KEY]' \
-H 'Content-Type: application/json' \
--data-raw '[
{
"floated_messages":{
"fields":[
"id",
"href",
"message",
"scope",
"user"
],
"constraints":[
{
"message.board.id":"VxRail"
},
{
"scope":{
"matches":"global"
}
}
],
"limit":5
}
},
{
"messages":{
"fields":[
"id",
"view_href",
"href"
],
"constraints":[
{
"board.id":"VxRail"
},
{
"id":{
"matches":"8122626"
}
}
],
"sorts":[
"post_time desc"
],
"limit":5
}
}
]'
Please let me know if this helps.