The contacts returned by GET /contacts/v1/contact/vids/batch/ have a firstname, and lastname attribute. However, if you create a new contact in Hubspot without filling in these attributes, then the attributes are missing from the API response.
In contrast to this, if I remove the firstname from an existing contact, the API response defaults the value to an empty string.
Could you please add these default values for the first case, as well?
Otherwise it would would be great to mention in the documentation that these properties in the response are optional.
By default, the endpoint returns all valued properties for a contact.
and so I would expect that if a contact who doesn't have a firstname or lastname, this two attributes wouldn't show up in the API response.
Additionally, based on our testing we know that if a contact who previously had these attributes filled up and remove later on, these attributes would also show up in the response body even though there's no value. I agree that this can be documentated to prevent any future confusion. For this, I'll work with our team!
As a side note, if you want to make the documentation perfectly clear, 'valued properties' means 'properties that are considered important' and not 'properties with a value attribute'.