Hey @Kamlesh_Singh
Yes, you can achieve that in 1 API call by developing a custom API in any of the content type collection controller.
Below is an example on how to achieve that:
In /api/content-type/routes/content-type.js file:
{
method: 'POST',
path: '/your-api-name',
handler: 'api::collectionName.collectionName.fetchAllData',
}
and add the function inside /api/content-type/controllers/content-type.js file:
fetchAllData(): async (ctx) => {
const collection1 = await strapi.db.query('api::collection-1.collection-1').findMany();
const collection2 = await strapi.db.query('api::collection-2.collection-2').findMany();
ctx.send({
status: 200,
data: {
'collection1_data': collection1,
'collection2_data': collection2
}
})
}
Set permission of the custom API from roles and you are good to go for executing the custom api.
Hope this information helps you ![]()
Thanks