Skip to content

Instantly share code, notes, and snippets.

@rruhlen
Created August 1, 2013 21:47
Show Gist options
  • Save rruhlen/6135659 to your computer and use it in GitHub Desktop.
Save rruhlen/6135659 to your computer and use it in GitHub Desktop.
loop through customer records
url = "/api/v2/customers"
begin
response = JSON.parse desk_client.get url
response['_embedded']['entries'].each do |customer|
desk_client.patch customer['_links']['self']['href'], {
custom_fields: {
some_field: 'Some Value'
}
}
end
url = response['_links']['next']['href'] rescue nil
end while not url.nil?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment