APIs & Integrations

product_fer
Participant

500 error when trying to create a contact

SOLVE

Here's the response I received.  Would appreciate your help

 

{"status":"error","message":"internal error","correlationId":"8a69d9e2-de63-4b5e-bc16-94eb9d933c4b"} 

 

I tried these two endpoints and received the same error:

From https://developers.hubspot.com/docs/methods/contacts/create_contact

0 Upvotes
1 Accepted solution
product_fer
Solution
Participant

500 error when trying to create a contact

SOLVE

I was able to fix this issue by passing in the Content-Type string in the headers array in this way:

 

$res = $client->request('POST', $endpoint, [
'body' => $post_json,
'headers' => [
'Content-Type' => 'application/json'
]
]);

View solution in original post

product_fer
Solution
Participant

500 error when trying to create a contact

SOLVE

I was able to fix this issue by passing in the Content-Type string in the headers array in this way:

 

$res = $client->request('POST', $endpoint, [
'body' => $post_json,
'headers' => [
'Content-Type' => 'application/json'
]
]);