Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kris01's avatar

Active Campaign API

Hello guys, am using this package https://github.com/Label84/laravel-active-campaign to make it easier with Active Campaign, but on user create I keep getting the error 404, the docuementation says that error 404 means No Result found for Subscriber with id 1 , I don't understand, does someone have experience with this?

API Documentation active campaing https://developers.activecampaign.com/reference/create-a-new-contact

$contactId = resolve(ActiveCampaign::class)->contacts()->create('[email protected]', [
    'firstName' => 'John',
    'lastName' => 'Doe',
    'phone' => '+3112345678',
]);
0 likes
12 replies
webrobert's avatar

also it the mentioned link shows a different format...

"contact": {
          "email": "[email protected]",
          "firstName": "John",
          "lastName": "Doe",
          "phone": "7223224241",
}

there isn't a second array

EDIT: oh I see. I was looking at the api not the GitHub

1 like
Kris01's avatar

@webrobert In User Service

  public static function CreateActiveCampaignUser(User $user)
    {

        $contactId = resolve(ActiveCampaign::class)->contacts()->create('[email protected]', [
            'firstName' => 'John',
            'lastName' => 'Doe',
            'phone' => '+3112345678',
        ]);
        
        \Log::debug('contact id ', $contactId->getBody());
    }
Kris01's avatar

@webrobert I was starting to think that the library is out dated but then I saw that the last update was just a few days ago, so I could not be that the problem

webrobert's avatar

@Kris01 you are getting a 404 response from their service? Hey, just a thought maybe they filter BS users. Have you tried a real email?

1 like
webrobert's avatar

@Kris01 double check the base url?

The API is accessed using a base URL that is specific to your account. In the examples provided in this documentation, we use the URL youraccountname.api-us1.com as a stand-in for your real account API URL. Your API URL can be found in your account on the My Settings page under the "Developer" tab. In addition, URL paths should begin with /api/3 to specify version 3 of the API. Generally, the URL will be in the form https://.api-us1.com/api/3/. All API calls should be made over HTTPS.`

https://developers.activecampaign.com/reference/url

webrobert's avatar
Level 51

I think the resource that is missing is the endpoint so it seems like a url issue

 https://<your-account>.api-us1.com/api/3/<resource>
1 like
Kris01's avatar

@webrobert when you mentioned this I was thinking maybe it was because i added the url in the .env like this

ACTIVE_CAMPAIGN_BASE_URL= https://<your-account>.api-us1.com/api/3/<resource>

then changed to this

ACTIVE_CAMPAIGN_BASE_URL=" https://<your-account>.api-us1.com/api/3/<resource>"

also restarted apache2 but not that...

Please or to participate in this conversation.