How to create a data explorer query with the APIs?

Thanks @Arkshine for the help.

It worked..!!