cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Ole_Luehn
Level III

How to set-up REST-API Link in script / what changed...?

Dear. 

I made a try to import data from a cloud via a Rest-API script - and it worked - so I continued with the table and "modified it, wrote specs, made graphs etc.".

Now, I re-opened the same script and in the log-file there is some error which I don´t unterstand in the log-file.

 

Please have a look in the png file. When I copy the https link into a browser, it works and shows data. 

Could it be that JMP doesn´t read the rest-api link because there are some < or [ or { which are missing in the link itself?

Question.png

@eromeu

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: How to set-up REST-API Link in script / what changed...?

The qm_data is HTML, not JSON. The <doctype> is the header on an HTML file. The JSON importer is producing the message because it does not understand HTML.

 

The JSON may be embedded in the HTML, or there may be a better rest api to get just the JSON data without an extra wrapper.

 

Ideally the rest api will return bare JSON. If necessary, you can write some sort of pattern matching/regex/substring JSL to dig the JSON out of the HTML.

 

use

write(qm_data); // if really long, use: write(left(qm_data,1000) ); 

and look at the log to see what you received. 

Craige

View solution in original post

4 REPLIES 4
Craige_Hales
Super User

Re: How to set-up REST-API Link in script / what changed...?

The qm_data is HTML, not JSON. The <doctype> is the header on an HTML file. The JSON importer is producing the message because it does not understand HTML.

 

The JSON may be embedded in the HTML, or there may be a better rest api to get just the JSON data without an extra wrapper.

 

Ideally the rest api will return bare JSON. If necessary, you can write some sort of pattern matching/regex/substring JSL to dig the JSON out of the HTML.

 

use

write(qm_data); // if really long, use: write(left(qm_data,1000) ); 

and look at the log to see what you received. 

Craige
Ole_Luehn
Level III

Re: How to set-up REST-API Link in script / what changed...?

Hi Craige.
Wonderful. Thank you very much!
Why is it so easy...;-)...

Best wishes. and thank you.
Ole
Craige_Hales
Super User

Re: How to set-up REST-API Link in script / what changed...?

Welcome! I also sent a request asking for the error message to be improved.

Craige
Byron_JMP
Staff

Re: How to set-up REST-API Link in script / what changed...?

...many things are easy for Craige  ; )

JMP Systems Engineer, Health and Life Sciences (Pharma)