Skip to content

Instantly share code, notes, and snippets.

Embed
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 + ':@api.close.com/api/v1/'
# get info about yourself
RestClient.get api_base+'me/'
# post a lead
lead_data = {
'name' => 'test lead',
'contacts' => [{
name: 'my person'
}]
}
RestClient.post api_base+'lead/', JSON.generate(lead_data), :content_type => :json, :accept => :json
@philfreo

This comment has been minimized.

Copy link
Owner Author

philfreo commented Mar 5, 2014

This uses https://github.com/rest-client/rest-client for simple REST calls

@philfreo

This comment has been minimized.

Copy link
Owner Author

philfreo commented Dec 17, 2019

Or, if you're looking for a more complete Ruby SDK for the Close API, check out https://github.com/taylorbrooks/closeio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.