Forum Discussion

anmi's avatar
anmi
Adept
2 years ago

JSON subquery returns spontaneous errors

When doing a json query with a subquery for labels, I get an error from time to time. 


[
{
"messages": {
"fields": [
"id",
"subject",
"search_snippet",
"body",
"cover_image.view_href",
"teaser",
"view_href",
"author",
"conversation.last_post_time",
"replies.count(*)",
"kudos.sum(weight)",
"metrics.views",
"labels"
],
"limit": 10,
"subQueries": {
"labels": {
"fields": [
"text",
"id"
]
}
}
}
}
]
 
Some requests return the correct result, but some return this error:
{
"status": "error",
"message": "An unexpected error occurred.",
"data": {
"type": "error_data",
"code": 301,
"developer_message": "",
"more_info": ""
},
"metadata": {}
}
 
The usage of the subquery is very valueable for us to avoid additional API requests for the labels in a loop.
 
What can I do to avoid the error while still using the subquery?
  • Can someone from the development team please advice, what to do?

  • anmi It can be tough to advise without checking the logs for your instance. You have rightly created a support ticket. I'd suggest responding to your ticket.