APIs & Integrations

PrasenjitDas
Participant

Search contact ID using any properties through API

Hi Team,

 

We are trying to get contact ID using other properties not just email. If you can suggest on this or implement this option it will be helpful for us to get contact id with using email and we can use other properties.

 

We tried doing this but got below error

 

Please help on this @hubspot @HDevelopers 

 

Input:-

var client = new RestClient("https://api.hubapi.com/crm/v3/objects/contacts/batch/read?archived=false&hapikey=************888888********* ");

var request = new RestRequest(Method.POST);

request.AddHeader("accept", "application/json");

request.AddHeader("content-type", "application/json");

request.AddParameter("application/json", "{\"properties\":[\"phone\",\"43565656565\"],\"propertiesWithHistory\":[\"phone\",\"111111\"],\"idProperty\":\"phone\",\"inputs\":[{\"id\":\"111111\"}]}", ParameterType.RequestBody);

IRestResponse response = client.Execute(request);

 

Output:-

{

  "status": "error",

  "message": "Contacts may only be looked up by 'email' as part of a unique property value request.  Property requested: phone",

  "correlationId": "************888888*********"

}

2 Replies 2
PrasenjitDas
Participant

Search contact ID using any properties through API

HI Dennis,

 

Thanks, we got it.😊

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Search contact ID using any properties through API

@PrasenjitDas 

Might be worth exploring the crm search endpoint

0 Upvotes