How to get an API report by utm parameters

The task is to get API data in the context of all 5 utm parameters: utm_source, utm_medium, utm_campaign, utm_term, utm_content

What query needs to be created in order to get this in one table. And so that there is a date and the ability to add another custom dimension

like for example here:

Thank you so much