cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cordova Plugin

seehua_voon1
Participant

I'm having issues getting the JSAgent to download to my Cordova application. The following error was observed:

#ERROR [2019-06-12 16:55:29]: Could not download the JSAgent! - Could not download agent file: 403
#INFO [2019-06-12 16:55:29]: Searching for HTML files ..

From what I can see from the Cordova Plugin's documentation, the plugin will try to download the js init code from:

http://url.com:PORT/profiles/Your_Profile_Name/applications/Your_Application_Name/javascriptagent/initcode

However, when I checked the REST-API of my Dynatrace AppMon Server, the path to the initcode is the following:

https://IP:PORT/api/v5/profiles/Your_Profile_Name/applications/Your_Application_Name/javascriptagent/initcode

I am guessing that the plugin is trying to download the JS agent from an invalid path, which caused the issue. If this is the case, what should I do to get the plugin to work properly again?


5 REPLIES 5

seehua_voon1
Participant
Forgot to put it into the post, but I noticed the path constructed by the plugin lacks /api/v5 in its path.

According to this documentation:

https://www.npmjs.com/package/dynatrace-cordova-plugin#installationAppMon

it looks like path is the same as expected. The question is if any of those uri's are working properly when you execute them manually?

Sebastian


matthias_hochri
Dynatrace Pro
Dynatrace Pro

The Cordova plugin uses /api/v1 in the URL. So this usually works, at least this is the first time I see this problem. 403 as error usually means forbidden, so are you sure that user and password is correct? If you try to use the URL with /api/v5 and put it in your browser, does it work and download the JSAgent file?


When I tried the v5 api via swagger interface, the login credentials worked. I'll change the api level to v2 tomorrow when I'm back to work and see if it works as well.



seehua_voon1
Participant

The path with v1 api worked when I accessed via the browser.


Thanks for the help people, I've somehow managed to get the cordova to work by using the localhost address instead of my laptop's public address. (My AppMon instance is hosted within my own laptop).