This:
api_url = [1, 2, 3, 20, 21, 22, 23, 24, 25, 27]
api_url.each do |deal|
response = HTTParty.get('http://api.pipedrive.com/v1/deals?filter_id=' + deal.to_s + '&start=0&sort_mode=asc&api_token=example')
result = JSON.parse(response.body)
end
spits out:
[1, 2, 3, 20, 21, 22, 23, 24, 25, 27]
rather than the resulting JSON it's supposed to. When I replace loop with just one single call rather than an array, this very similar block afterwords works perfectly:
stage_deal_ids.each do |deal|
response = HTTParty.get('http://api.pipedrive.com/v1/deals/' + deal.to_s + '/activities?start=0&api_token=example')
result = JSON.parse(response.body)
end