The easiest way to build query is through UI, you could first create an insight chart, and then Export as cURL.

screenshot

Language
Credentials
Click Try It! to start a request and see the response here!