APIs & Integrations

Not applicable

Error while merging contacts

I’m trying to use the merge contact API call. But when I use it I get a Ok response (200) but in the body I get the following error: “Invalid JSON string”

I’m calling the URL https://api.hubapi.com/contacts/v1/contact/merge-vids/6295/?hapikey=MYKEY with the following body:
{“vidToMerge”:12502}

0 Upvotes
2 Replies 2
Not applicable

Error while merging contacts

Yea it was that, my library doesn’t support single strings as valid Json.
More info on this if anyone is interested http://www.mattlunn.me.uk/blog/2014/01/what-is-the-minimum-valid-json/

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Error while merging contacts

Hi @divad4686

The response body for a successful merge is going to be just the text SUCCESS, which may not be considered valid JSON depending on the parser you’re using.

0 Upvotes