FCLM
FCLM

Reputation: 95

How to set/update the lead owner using Zoho API v2?

I want to update the lead owner by using their email address, and not their ID. I know it is possible because I've done it before but I didn't save the request I made, and I don't remember how I did it.

Something like this:

URL: https://www.zohoapis.com/crm/v2/Leads/upsert
BODY:
{
  "data": [
    {
      "Owner": {
        "Email": "[email protected]"
      },
      "Email": "[email protected]"
    }
  ]
}

I'm getting an error saying I need to provide the Owner ID, but I'm not supposed to care about it, since the email is already their identifier.

When I request something like this:

{
  "data": [
    {
      "Owner": 4528855000067045001,
      "Email": "[email protected]"
    }
  ]
}

Or this:

{
  "data": [
    {
      "Owner": {
        "id": 4528855000067045001
      },
      "Email": "[email protected]"
    }
  ]
}

I get "MANDATORY_NOT_FOUND: Last_Name". Even inserting a "Last_Name" nothing works.

Can someone help me please? Thank you!

Upvotes: 2

Views: 598

Answers (1)

FCLM
FCLM

Reputation: 95

I found the error: my mistake was leaving the "Email" key on the "Owner" object capitalized. The correct way is:

{
  "data": [
    {
      "Owner": {
        "email": "[email protected]"
      },
      "Email": "[email protected]"
    }
  ]
}

Solved.

Upvotes: 1

Related Questions