CRM

DTeam1
Member

Unable to Update Contacts Via Email

SOLVE

We are attempting to update contacts via the email property rather than ID using a private app connection on Contacts API v3.

 

We can successfully make the call with the actual contact ID, but receive an error when attempting with email.

 

The CRM API Docs say:
"The idProperty query parameter doesn't appear on the Endpoints tab due to technical limitations, but it can be used for contacts exclusively with email. To use an email address as the unique identifier, set the idProperty as email and enter the email address in place of the contact ID. This should be set as a query parameter rather than added to the request body."

 

The bearer token/private app is verified to be working properly when making calls because I tested it before trying this specific action.

We have went through several articles and solutions like the one below and have not been able to resolve this issue.
>
https://community.hubspot.com/t5/APIs-Integrations/Update-contact-with-email-as-ID-through-the-Hubsp...

 

Here is the POST request I am attempting to make:

https://api.hubapi.com/crm/v3/objects/contacts/batch/update?idProperty=email

 

Here is the Body that is being attempted:

{
    "inputs": [
        {
            "id": "tstemail@gmail.com",
            "properties": {
                "company": "Company239",
                "email": "emailtes@gmail.com",
                "firstname": "Test Update",
                "lastname": "lnme",
                "phone": "(877) 999-9999",
                "website": "website.com"
            }
        }
    ]
}

 

Response:

"status": "error",
            "category": "OBJECT_NOT_FOUND",
            "message": "Could not get some CONTACT objects, they may be deleted or not exist. Check that ids are valid.",
            "context": {
                "ids": [
                    "tstemail@gmail.com"
                ]
 
 
1 Accepted solution
MrJustinGivens
Solution
Top Contributor | Partner
Top Contributor | Partner

Unable to Update Contacts Via Email

SOLVE

Hey @DTeam1,

 

I don't think idProperty=email works on the batch request. 

 

I was able to reproduce your problem.

 

When I used the single PATCH update for a contact using the email address as the contact ID. The API worked.

 

/crm/v3/objects/contacts/tstemail@gmail.com?idProperty=email

 

My guess is because BATCH wants the contact ID to make the updates faster and not have to search by email. (Just a guess).

 

Hope this helps.










Justin Givens


HUG Leader & Community Champion


Resident HubSpot Nerd | Image in a Box






 












mobilePhone





(256) 886-8269 | (256) 434-5877







emailAddress





justin@imageianbox.com







website





imageinabox.com







 





Schedule a time to talk







website





Let's connect on LinkedIn

















View solution in original post

1 Reply 1
MrJustinGivens
Solution
Top Contributor | Partner
Top Contributor | Partner

Unable to Update Contacts Via Email

SOLVE

Hey @DTeam1,

 

I don't think idProperty=email works on the batch request. 

 

I was able to reproduce your problem.

 

When I used the single PATCH update for a contact using the email address as the contact ID. The API worked.

 

/crm/v3/objects/contacts/tstemail@gmail.com?idProperty=email

 

My guess is because BATCH wants the contact ID to make the updates faster and not have to search by email. (Just a guess).

 

Hope this helps.










Justin Givens


HUG Leader & Community Champion


Resident HubSpot Nerd | Image in a Box






 












mobilePhone





(256) 886-8269 | (256) 434-5877







emailAddress





justin@imageianbox.com







website





imageinabox.com







 





Schedule a time to talk







website





Let's connect on LinkedIn