Skip to content

Instantly share code, notes, and snippets.

Last active September 15, 2022 00:52
What would you like to do?
Close API Ruby RestClient Example
require 'rest_client'
require 'json'
API_KEY = 'your api key here'
api_base = 'https://' + API_KEY + ''
# get info about yourself
RestClient.get api_base+'me/'
# post a lead
lead_data = {
'name' => 'test lead',
'contacts' => [{
name: 'my person'
} api_base+'lead/', JSON.generate(lead_data), :content_type => :json, :accept => :json
Copy link

philfreo commented Mar 5, 2014

This uses for simple REST calls

Copy link

Or, if you're looking for a more complete Ruby SDK for the Close API, check out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment