Created
December 14, 2017 12:50
-
-
Save patrykkalinowski/bfb784708c7bf42e851c00a51f171cb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest-client' | |
require 'json' | |
properties = File.open('./hubspot-contact-properties-list-shortened.txt') | |
request = "http://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=APIKEY&showListMemberships=true&formSubmissionMode=all&count=1000" | |
properties.each do |property| | |
request << "&property=#{property}" | |
end | |
response = JSON.parse(RestClient.get(request)) | |
puts "Received contacts: #{response['contacts'].count}" | |
puts "Received contact datapoints: #{response['contacts'].first.keys.count}" | |
puts "Received properties: #{response['contacts'].first['properties'].count}" | |
puts "Received properties: #{response['contacts'].first['properties'].keys}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment