
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Zendesk Sell is a Ruby client for the Zendesk Sell (Sales CRM) API. This gem provides a robust and modular interface to interact with Zendesk Sell’s resources—such as leads, deals, contacts, companies, tasks, and users—using Faraday for HTTP requests.
Add this line to your application's Gemfile:
gem 'zendesk_sell'
Then execute:
bundle install
Or install it yourself via:
gem install zendesk_sell
The client uses the SELL_ACCESS_TOKEN environment variable by default. You can also pass the token directly when initializing the client.
Using an Environment Variable
Set your token in your shell or Rails application configuration:
export SELL_ACCESS_TOKEN="your_actual_sell_access_token"
client = ZendeskSell::Client.new(access_token: 'your_actual_sell_access_token')
The zendesk_sell
gem supports the following API endpoints:
Below are several examples demonstrating how to use the client with various Zendesk Sell resources.
List All Leads
client = ZendeskSell::Client.new
leads = client.leads.list(page: 1, per_page: 20)
puts leads
List All Deals
deals = client.deals.list(page: 1, per_page: 20)
puts deals
Retrieve a Specific Lead
lead_id = 123
lead = client.leads.find(lead_id)
puts "Lead Details: #{lead}"
Retrieve a Specific Contact
contact_id = 456
contact = client.contacts.find(contact_id)
puts "Contact Details: #{contact}"
Create a New Lead
new_lead_attributes = {
first_name: "Alice",
last_name: "Smith",
email: "alice.smith@example.com",
phone: "+11234567890"
}
created_lead = client.leads.create(new_lead_attributes)
puts "Created Lead: #{created_lead}"
Create a New Deal
new_deal_attributes = {
title: "New Business Opportunity",
value: 5000,
currency: "USD"
}
created_deal = client.deals.create(new_deal_attributes)
puts "Created Deal: #{created_deal}"
Update an Existing Lead
lead_id = 123
updated_attributes = { name: "Jane Doe", phone: "+1987654321" }
updated_lead = client.leads.update(lead_id, updated_attributes)
puts "Updated Lead: #{updated_lead}"
Update a Company
company_id = 789
updated_company_attributes = { name: "Acme Corp", industry: "Technology" }
updated_company = client.companies.update(company_id, updated_company_attributes)
puts "Updated Company: #{updated_company}"
Delete a Lead
lead_id = 123
client.leads.delete(lead_id)
Delete a Deal
deal_id = 456
client.deals.delete(deal_id)
begin
lead = client.leads.find(9999) # Assuming 9999 is an invalid ID
rescue ZendeskSell::Errors::ApiError => e
puts "API Error: #{e.message}"
rescue ZendeskSell::Errors::ConnectionError => e
puts "Connection Error: #{e.message}"
end
results = client.leads.search(
{
"filter" => {
"filter" => {
"attribute" => { "name" => "email" },
"parameter" => { "eq" => "john.doe@example.com" }
}
},
"projection" => [
{ "name" => "id" },
{ "name" => "name" },
{ "name" => "email" }
]
}
)
bundle exec rspec
Bug reports and pull requests are welcome on GitHub at https://github.com/RTJ/zendesk_sell.
License
This gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that zendesk_sell demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.