I have the following piece of JSON returned to a Ruby RestClient post request:
{"importResults":[{"status":"success","id":"ed2a89538d84eff5b92b5baad1fb5a4e"}]}
I am trying to retrieve the status (success) and the id (ed2a89538d84eff5b92b5baad1fb5a4e).
I tried the following code:
jdoc = JSON.parse(jsonAbove)
status = jdoc.fetch("importResults").fetch("status")
This is giving me back the error TypeError: can't convert String into Integer.
I know it's because there is an array in the response that I'm getting this error but I can't seem to get it right.