APIs & Integrations

jev
Member

"Create or Update a Group of Contacts" Failed

Hi all,

I want to update group of contact like in this link

Create or update a group of contacts | Contacts API

POST /contacts/v1/contact/batch/ - Create a group of contacts or update them if they already exist.

with input like this:
(
[0] => Array
(
[vid] => 7093551
[properties] => Array
(
[0] => Array
(
[property] => full_name
[value] => MyName
)

            )

    )

[1] => Array
    (
        [vid] => 8639451
        [properties] => Array
            (
                [0] => Array
                    (
                        [property] => full_name
                        [value] => Othername
                    )

            )

    )

)

If I call to this url end point :
http://api.hubapi.com/contacts/v1/contact/batch/?hapikey=” . self::HAPIKEY

It will return status code 200 & the data is not updated.

Please tell me why don’t it return 202 as successful call?
Thank you

0 Upvotes
1 Reply 1
jev
Member

"Create or Update a Group of Contacts" Failed

I have solved this. It’s because I didn’t add application/json setting.

	curl_setopt( $ch , CURLOPT_HTTPHEADER , array (
			'Content-Type: application/json' ,
			'Content-Length: ' . strlen( $data_string )
		)
	);

Now it’s working fine.