anmi
3 years agoAdept
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?