I'm trying to get metering data from a RESTful service via excel and parse the data directly into spreadsheets.
I've figured out the basics working through your examples and even am able to get JSON data into a spreadsheet if I manually copy the JSON string from a simple REST client in a cell in another spreadsheet, but I'm having problems getting the data directly via generalQuery. I'm getting an authentication error.
The API of the REST service I'm using requires a user to authenticate via a POST that returns no data, but does pass back a cookie in the response header. I'm able to do this via a simple rest client in a browser as the browsers handle this automatically, but I'm a bit lost how to do this in excel. I've looked at the Cookies and Excel section of your website, but it's not really clarified it for me.
I need help to figure out how to do an authentication POST call from within Excel and store the cookie. Then I need to attach the cookie to the next restQuery to GET data and also ensure that the new cookie value from the response header is stored and used for the next query, and so forth...
The POST call to get the cookie is fairly simple, although I can't share the system specifics.
with this data:
{"password": "acmeadminpassword", "user": "/acme/administrator"}
The response header includes a line that sets the cookie:
Set-Cookie: nimbula={"insert oreo cookie stuffing here"}
After authenticating, every call updates the cookie, which expires in an hour if no further calls are made, at which point re-authentication is required.
Any help or direction you can provide to get me going would be greatly appreciated.
Thanks,
Don