APIs & Integrations

Wojciech
Participant

Creating a new contact does not return an email field in response

SOLVE

The problem is that when I'm creating a new contact [1], an email field does not appear in the response (even though the field was defined). Instead, I get a leadin_email_SOME_MD5_HASH field:

"properties": {
  "leadin_email_MD5_HASH_HERE": {
    "value": "foo@barbaz.com",
    "versions": [
      {
        "value": "foo@barbaz.com",
        "source-type": "INTEGRATION",
        "source-id": "xxxxxx",
        "source-label": null,
        "timestamp": 1560866086845,
        "selected": false
      }
    ]
  },
      
  (...)
}

Email can be easily extracted from this response, but another problem occurs when I want to fetch contacts by email addresses [2]. Nothing is found. It seems that a similar issue has appeared in HubSpot before [3].

 

This issue cannot be reproduced on other accounts.

 

[1] https://developers.hubspot.com/docs/methods/contacts/create_contact
[2] https://developers.hubspot.com/docs/methods/contacts/get_batch_by_email
[3] https://integrate.hubspot.com/t/hubspot-shows-two-email-fields-trying-to-add-new-contact-from-panopl...

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Creating a new contact does not return an email field in response

SOLVE

Hi, @Wojciech.

 

Apologies for the delayed response; I appreciate your patience.

 

I successfully created a contact in account 4235042 with this endpoint. The response included the email property as I would expect.

 

I've sent you a direct message with a video of my test.

 

I know from past experience that fields containing leadin_ are created by our non-HubSpot forms tool (formerly "collected forms"). Since the email value you were using is commonly used for testing, I wonder whether you are encountering some strange interference with it.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
6 Replies 6
IsaacTakushi
HubSpot Employee
HubSpot Employee

Creating a new contact does not return an email field in response

SOLVE

Welcome, @Wojciech.

 

That is very strange. I have not been able to replicate this behavior in my own account.

 

Can you confirm and share the following to help me investigate further?

  1. The full request URL you used. (Please don't include API keys.)
  2. An example request body which created a contact and triggered this behavior.
  3. The full API response (beginning with {"vid:  and status code.

Isaac Takushi

Associate Certification Manager
0 Upvotes
Wojciech
Participant

Creating a new contact does not return an email field in response

SOLVE

Please, do not delete this again!

 

@IsaacTakushi   Hey, thanks for your reply!

 

1. https://api.hubapi.com/contacts/v1/contact

2. Sample request body:

{
  "properties": [
    {
      "property": "hubspot_owner_id",
      "value": CENSORED_FOR_PRIVACY_PURPOSES
    },
    {
      "property": "email",
      "value": "foo@bar.com"
    },
    {
      "property": "firstname",
      "value": "Jon"
    },
    {
      "property": "lastname",
      "value": "Doe"
    }
  ]
}

3. RESPONSE

Status code: 200

Body:

{
    "vid": 1009251,
    "canonical-vid": 1009251,
    "merged-vids": [],
    "portal-id": 4235042,
    "is-contact": true,
    "properties": {
      "leadin_email_SOME_MD5_HASH": {
        "value": "foo@bar.com",
        "versions": [
          {
            "value": "foo@bar.com",
            "source-type": "INTEGRATION",
            "source-id": "193388",
            "source-label": null,
            "timestamp": 1560866086845,
            "selected": false
          }
        ]
      },

     (....) other properties e.g. firstname, 
}

 

I cannot reproduce this on other accounts.

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Creating a new contact does not return an email field in response

SOLVE

Hi, @Wojciech.

 

Thanks for sending this along. Sorry that this platform's spam filter deleted your original post — it tends not to like multiple code blocks in posts.

 

I'm taking a look at this contact in your account and don't see any email value for it. Could you direct message me the full payload you used? This endpoint does allow you to create records without an email, so I wonder if we're encountering funkiness with that functionality.


Per your last statement, are you saying you cannot reproduce this with any other contact records or HubSpot accounts (i.e. portals)?

Isaac Takushi

Associate Certification Manager
0 Upvotes
Wojciech
Participant

Creating a new contact does not return an email field in response

SOLVE

@IsaacTakushi I wrote a private message with more details. I'd be very grateful for your help. 

 

> Per your last statement, are you saying you cannot reproduce this with any other contact records or HubSpot accounts (i.e. portals)?

The problem occurs in only one account and manifests itself in the fact that after creating a contact I do not receive the "email" field in response (even though the field was defined). This behavior cannot be reproduced in any other account.

 

Wojciech

0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Creating a new contact does not return an email field in response

SOLVE

Hi, @Wojciech.

 

Apologies for the delayed response; I appreciate your patience.

 

I successfully created a contact in account 4235042 with this endpoint. The response included the email property as I would expect.

 

I've sent you a direct message with a video of my test.

 

I know from past experience that fields containing leadin_ are created by our non-HubSpot forms tool (formerly "collected forms"). Since the email value you were using is commonly used for testing, I wonder whether you are encountering some strange interference with it.

Isaac Takushi

Associate Certification Manager
0 Upvotes
Wojciech
Participant

Creating a new contact does not return an email field in response

SOLVE

Hey, thanks for your reply!

 

1. https://api.hubapi.com/contacts/v1/contact

2. Sample request body:

{
  "properties": [
    {
      "property": "hubspot_owner_id",
      "value": CENSORED_FOR_PRIVACY_PURPOSES
    },
    {
      "property": "email",
      "value": "foo@bar.com"
    },
    {
      "property": "firstname",
      "value": "Jon"
    },
    {
      "property": "lastname",
      "value": "Doe"
    }
  ]
}

3. RESPONSE

Status code: 200

Body:

{
    "vid": 1009251,
    "canonical-vid": 1009251,
    "merged-vids": [],
    "portal-id": 4235042,
    "is-contact": true,
    "properties": {
      "leadin_email_SOME_MD5_HASH": {
        "value": "foo@bar.com",
        "versions": [
          {
            "value": "foo@bar.com",
            "source-type": "INTEGRATION",
            "source-id": "193388",
            "source-label": null,
            "timestamp": 1560866086845,
            "selected": false
          }
        ]
      },

     (....) other properties e.g. firstname, 
}

 

0 Upvotes