How to create Contact using POST HTTP API

Dear Team,

I want to get contact created in my Hubspot account with the help of POST HTTP API. Mobile number will be pushed from a my company IVR resources.

Kindly help me with Push Report Webhook API, POST Method.

Thanks

Welcome, @AppyPlanet.

It sounds like you want to use either this endpoint or this endpoint from the Contacts API.

If you have any specific questions on how to use them, let me know.

Dear Sir,

Thank you for your reply.

It was very helpful.

I want to pass Phone Number in API https://api.hubapi.com/contacts/v1/contact/?hapikey=demo

Please help me with the parameter to add in this API.

Thanks

Hi, @AppyPlanet.

Glad I could help.
If you wish to use the Create a new contact endpoint, you can create a contact and pass a phone number to the phone property with a payload like this:

POST
https://api.hubapi.com/contacts/v1/contact/?hapikey=your_key

{
 "properties": [
 {
 "property": "email",
 "value": "contact_email@example.com"
 },
 {
 "property": "phone",
 "value": "555-122-2323"
 }
 ]
}

Please note that email property is required to create a contact in HubSpot.

Dear @IsaacTakushi ,

Thank you for reply.

My point is, how to pass contact properties in API ?

like https://api.hubapi.com/contacts/v1/contact/?hapikey=your_key&phone=123&email=example@example.com

Thanks

Hi, @AppyPlanet.

If you are creating a company through this POST endpoint, you cannot add properties as query parameters. Instead, they must be in the request’s payload, or body, in JSON format.

If you are retrieving a contact’s data through this GET endpoint, on the other hand, you can define properties to be included in the response with query parameters. This will not create or update a contact.

Dear @IsaacTakushi ,

Thank you for reply.

I am using IVR service.

My requirement is to create a contact using POST API.

Parameter for contact number in IVR service is “cNumber” and “phone” in Hubspot.

Parameters are not generic.

I am not able to create a new contact by integrating POST API to IVR service.

Please suggest me the resolution.

Thanks

Hi, @AppyPlanet.

If you are trying to create contacts in HubSpot with information from your IVR service, you will have to have some intermediary app or middleware take email and cNumber values from your IVR service and then create and send requests containing email and phone properties to this HubSpot endpoint.

Can you specify where in the process you are encountering issues?

Thank you @IsaacTakushi for the help.