Thank you for posting your question. I’ve checked the logs for your tenant and see several failed login attempts that are undefined as redirecturi and invalid. Can you try to adjust the redirect_uri for the application that you are trying and set a proper client_id from the application list? If you want to access the API from the M2M application, you must Authorize it first in the API-> select API → Machine to Machine Applications.
thanks @dawid.matuszczyk for your response but after applying your suggestion i landed on the signin page of my app and i want to ask how to get the result as a json or something like that but i got full HTML.