Hi @Vaisha Bernard · Welcome to Q&A platform and thanks for your query.
Unfortunately this is not possible. You can fetch all the details of a given application only when you have permission to read the application objects in the tenant where the application is registered, which require roles such as application developer/application admin/cloud application admin/global admin etc. to be assigned to the user.
Also, from engineering perspective, searching an application globally with App ID without tenant info. will be a very intensive query as the search would need to be performed against millions of Azure AD tenants.
The example that you have shared only works for multi-tenant applications and can't be used for single tenant apps. The purpose of the adminconsent endpoint is, for admins to review the publisher and permissions, that application will be having in the tenant after the admin grants consent and creates a service principal corresponding to the app in his tenant. Also, this is not an efficient way of fetching the information.
Feel free to tag me in your reply if you have any further questions.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.