Is there any API for getting App Token & DBIDS w.r.t to table name?

Application Tokens are associated with Applications not individual tables. Additionally, there can be several Application Tokens associated with an Application. Given these two observations it isn't clear what your original question is asking or what you are trying to accomplish.

In any case when you are trying to automate some task across your entire account it can be problematic using the API because there is often no common Application Token to use within your script (unless you manually set this up). In these cases you can still write the script but you have to use non-API methods. This may seem unusual if it is your first exposure to the technique but you can GET or POST to any QuickBase endopoint URL using AJAX methods.

I assumed you were injecting your code into a QuickBase authored page in which case the global is available. However, code pages are completely empty and consist of only the code you explicitly include - so you don't have access to any QuickBase globals nor any libraries such as jQuery unless you load them yourself into the code page.