Problem
Some web sites provide a REST API to read data, and often the response is text in JSON format. How do we get that into JMP?
Solution
Here is a example using the meetup.com REST API. It's relatively simple since it uses the common "GET" method, which is the default for web page reading. More elaborate messages use the "POST" method which would require a different approach. With the GET request, the inputs are appended to the URL itself.
my key = load text file("meetupkey.txt");
s = load text file( url );
b = char to blob(s);
dt = open(b, "JSON");
Discussion
After reading the data, I often do some clean-up and create convenience columns, such as:
dt << New Column("reply time", formula(:results.mtime/1000 + 01Jan1970), format("ddmonyyyy"));
dt << New Column("count", formula(if(:results.response=="yes", :results.guests + 1, 0)));
Having this in a scripts makes it easy to refresh my data as needed. Now I'm ready to do some exploration..