I get an error message when I access a REST API via load text file()
load text file ("http://api.open-notify.org/iss-now.json");On the other hand, it works when I use web()
New Window("", web browser = Web Browser Box ( "http://api.open-notify.org/iss-now.json", JMP window ));
Is there a way to retrieve the JSON string via the Web Page Box?
web browser << Get text;
http://api.open-notify.org/iss-now.json is just used to explain the difference. With this API both approaches work.
Next try:
save the content of the web page box and red the save file.
web browser << save ()... but the saved file is empty: How to save webpages through JSL
So, I use Selenium to directly access my External Web Browser and send the commands.
Have you tried using New HTTP Request or Open?
Names Default To Here(1);
request = New HTTP Request(
URL("http://api.open-notify.org/iss-now.json"),
Method("GET")
);
data = request << Send;
aa = Parse JSON(data);
// dt = Open("http://api.open-notify.org/iss-now.json");
yes, I tried both.
Seems that web() is using the web browser of my system - with the benefit of getting the access.
On the other hand this might prevent us from accessing the content? [out of reach for JMP?]
Might be worth trying to figure out why New HTTP Request doesn't work.
via Web(), it seems that JMP automatically inherits the permissions from the browser.
I just found:
https://community.jmp.com/t5/JMP-Wish-List/Additional-Wait-type-command/idi-p/626084
Security setting prevent me from getting credentials via the embedded browser.
So I tried
oauth2 = New OAuth2( Browser Type( "External" ) );
This way, the authentication works - but I don't get a"code" or "URL" which I could enter here:
Next try:
save the content of the web page box and red the save file.
web browser << save ()... but the saved file is empty: How to save webpages through JSL
So, I use Selenium to directly access my External Web Browser and send the commands.
To skip the Selenium part, is there some UseDefaultCredentials setting to use the credentials of my user account to access the files?
I would guess there is a cookie stored somewhere which you might be able to utilize. Are you able to contact the developers of the API and ask for them to create endpoint which could be used with some other authentication method?