Trying to add contacts via ActiveCampain API (Laravel)

alularegional
edited January 25 in Integrations

I´m trying to integrate the RESTFUL API of ActiveCampaing to my Laravel environment, but I haven’t been so luckier, I’m using GuzzleHttp to make the requests, this is the error image and my code:

$client = new \GuzzleHttp\Client([‘base_uri’ => ‘https://myaccount.api-us1.com/api/3/’]);

$response = $client->request(‘POST’, ‘contacts’, [

‘headers’ => [

‘Api-Token’ => ‘****’,

‘api_action’ => ‘contact_add’,

],

‘json’ => [

‘email’ => ‘[email protected]’,

‘first_name’ => ‘Julian’,

‘last_name’ => ‘Carax’,

]

]);

echo $response->getStatusCode(); // 200

echo $response->getBody();

Sign In or Register to comment.