Can't Add Contact to List Using API

contacts

#1

I’m trying to use the Hubspot API to add a contact to a list. Here’s the URL:

https://api.hubapi.com/contacts/v1/lists/1332/add?hapikey=

Here’s the body example of the HTTP POST:

{
“emails”: [
"email@test.com"
]

}

I get an HTTP/1.1 200 OK and body response is empty. I check the list on Hubspot but don’t see the contact added. This is a static list. Does anyone have any ideas? Thanks.


#2

Hi @developez,

The response body should contain a JSON object with the results of your request. Can you send me a link to the static list in your HubSpot portal?


#3

Hi Derek

I have solved the problem by adding in the header of the request

‘Content-type’: ‘application/json’

Thanks :slight_smile: