I'm trying to use this conditional so if the response does not contain a sectionid it will return the first response and if it does contain a sectionid it will return the second response. The problem is, is that sectionid is in the response and I'm not sure how to define the conditional with the response before I make the request, the way I'm currently doing it the first response is returned no matter the circumstance of the request. any help would be much appreciated thanks.
def show
if "sectionId" != true
@events = Unirest.get("https://api.stubhub.com/search/inventory/v2?eventid=#{params[:id]}&limit=1000&start=0&rows=1000§ionStats=true", headers:{"Accept" => "application/json", "Authorization" => "Bearer*****"}).body
else
@events = Unirest.get("https://api.stubhub.com/search/inventory/v2/sectionsummary?eventid=#{params[:id]}", headers:{"Accept" => "application/json", "Authorization" => "Bearer ******"}).body
end