title: Validating JSON response using rest client
body: <p>I am trying to use rest client in ruby to parse json but I am stuck how to validate the response (extract values from the response). Also I am trying to validate the valid response code(200) response.code does not work.
  Following is the JSON response and Code that uses rest client to get it:</p>
  
  <pre><code>def self.call_legacy_transactions
  
    get_response=RestClient::Request.execute(method: :get, url: 'URL', timeout: 15)
    puts(get_response.body)
    json_response = JSON.parse(get_response)
  //Dont know how to get the values from response hash. Please suggest
  
    end
  </code></pre>
  
  <p>JSON Response:</p>
  
  <pre><code>    [
    {
      "value": "12345678912345",
      "events": [
        {
          "transaction_id": 205,
          "package_name": "",
          "event_codes": [
            465,
            469,
            471,
            474,
            410,
            490,
            1040
          ]
        },
        {
          "transaction_id": 204,
          "package_name": "",
          "event_codes": [
            465,
            469,
            474,
            490
          ]
        },
        {
          "transaction_id": 207,
          "package_name": "",
          "event_codes": [
            465,
            469,
            471,
            474,
            490
          ]
        }
      ]
    }
  ]
  </code></pre>
  
  <p>I want the event code for each transaction for each value.</p>