I store leads and get get leads by, for example, email by making a GET request to /rest/v1/leads.json?filterType=email&filterValues=example@example.com endpoint. I get the following as a result:
From here I can get the id of a lead. So I want to update a custom field this lead has (let's call it allowedToEmail). I can also get details about it by making a GET request to /rest/v1/leads/describe.json endpoint:
What I want is to update its value to false, making a POST request to /rest/v1/leads.json with the following body does is not working:
{
"action": "updateOnly",
"input": [
{
"id": 4788743,
"allowedToEmail": false
}
]
}
Any ideas on how this can be achieved? I greatly appreciate your help.
Solved! Go to Solution.
You left out the
lookupField
property.
Look more closely at the required payload.
Doing this does not help:
{
"action": "updateOnly",
"input": [
{
"id": 4788743,
"membership": {
"allowedToEmail": false
}
}
],
"lookupField": "allowedToEmail"
}
The error message is the following:
I am getting the impression that what I am trying to do is not possible via exposed APIs.
Of course it’s possible to update lead fields!
Sanford Whiteman it works perfect now. You made my day!
Cool, pls mark my answer as Correct, thanks.
The lookup field is id.