KentonWhite / zohoho

Simple interface to zoho api
MIT License
8 stars 11 forks source link

Added delete lead method #3

Closed nolastan closed 12 years ago

nolastan commented 12 years ago

can search by email (requires additional call to get the ID)

includes passing spec

nolastan commented 12 years ago

ok this isn't actually working.

{"response": {"uri":"/crm/private/json/Leads/deleteRecords","error": {"code":4832,"message":"id parameter is missing"}}}

KentonWhite commented 12 years ago

Thanks for the addition, it's great! I made one change, which is the return value for remove_lead. In the spec it is expecting and empty array but returns the whole response from Zhoho. To be consistent with other methods, if successful it returns the item id of the deleter record, otherwise it returns false.

I also removed the Rails.env.production code for debugging since it assumes a rails environment, which may not be the case for people using the gem.

One question to consider. When creating a lead you require a company and an last name. However every other method is looking up the lead my email. To be consistent, would it make sense to require an email when creating a lead, but then allowing other properties like company and name to be passed in the info hash? Thoughts?

nolastan commented 12 years ago

Thanks for making the changes. I did this quite hastily and want to clean it up even more when I get a chance. We're using the gem quite heavily.

Good call on the rails env - that was more a personal thing and I shouldn't have committed it.

I have a CRM class in my own app that is wrapping this gem; I'm not even using the company field. It was there from before. I think it makes sense to make email the only required field and use emails as a unique id with the help of find_leads_by_email.

nolastan commented 12 years ago

I'm game for working out a plan for this gem, including consistent ways to access leads and contacts and caching. I'll think more about this and share my thoughts. There are several forks of this gem so we could probably get some others to chime in and contribute.

KentonWhite commented 12 years ago

Sounds like a plan. I've made you collaborator on the repository. If you don't want that let me know and I can remove you.

Kenton White

On Sep 18, 2012, at 2:48 PM, Stan notifications@github.com wrote:

I'm game for working out a plan for this gem, including consistent ways to access leads and contacts and caching. I'll think more about this and share my thoughts. There are several forks of this gem so we could probably get some others to chime in and contribute.

— Reply to this email directly or view it on GitHub.