APIs & Integrations

LUnderwood
Participant

Error batch reading contacts with custom property

SOLVE

I am attempting to make a request to this endpoint to fetch contacts with a custom property - https://developers.hubspot.com/beta-docs/reference/api/crm/objects/contacts/v3#post-%2Fcrm%2Fv3%2Fob... . However, I am receiving the following error

 

{
  "status": "COMPLETE",
  "results": [],
  "numErrors": 1,
  "errors": [
    {
      "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": [
          "AC9d12c90a228fd85bb334e7cabfcba435a5716772"
        ]
      }
    }
  ],
  "startedAt": "2024-11-22T16:55:24.150Z",
  "completedAt": "2024-11-22T16:55:24.211Z"
}

 

This is an example of the curl request I am using:

curl --request POST \
  --url 'https://api.hubapi.com/crm/v3/objects/contacts/batch/read' \
  --header 'authorization: Bearer my-token' \
  --header 'content-type: application/json' \
  --data '{
  "properties": ["my_custom_property"],
  "idProperty": "my_custom_property",
  "inputs": [
    {
      "id": "AC9d12c90a228fd85bb334e7cabfcba435a5716772"
    }
  ]
}'

 

The contact definitely exists and contains this property + value. Is the request body incorrect in some way that I am not understanding?

0 Upvotes
1 Accepted solution
zach_threadint
Solution
Top Contributor

Error batch reading contacts with custom property

SOLVE

Hi @LUnderwood 👋

 

Is your custom property configured as a "unique identifier" (i.e. the property's hasUniqueValue attribute is set to true)? If not, you won't be able to use it as an idProperty for any HubSpot APIs that support this feature. More info about how you can configure "unique identifier properties" can be found here (see the 

"Create unique identifier properties" section).

 

I hope this proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

1 Reply 1
zach_threadint
Solution
Top Contributor

Error batch reading contacts with custom property

SOLVE

Hi @LUnderwood 👋

 

Is your custom property configured as a "unique identifier" (i.e. the property's hasUniqueValue attribute is set to true)? If not, you won't be able to use it as an idProperty for any HubSpot APIs that support this feature. More info about how you can configure "unique identifier properties" can be found here (see the 

"Create unique identifier properties" section).

 

I hope this proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.