Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix needed for Active Campaign API v1 issue #1239

Open
DennisNDean opened this issue Aug 16, 2023 · 0 comments
Open

Hotfix needed for Active Campaign API v1 issue #1239

DennisNDean opened this issue Aug 16, 2023 · 0 comments

Comments

@DennisNDean
Copy link

The Active Campaign V1 API has started returning a 403 forbidden error when the API key is passed in the body of the request, but it works if it's in the header.

See: https://community.activecampaign.com/t/acces-suddenly-refuses/21272
https://community.activecampaign.com/t/activecampaign-api-v1-403-error/21273

Changing includes/service-providers/active_campaign/class-newspack-newsletters-active-campaign.php starting at line 167 from

$args     = [
	'method'  => $method,
	'headers' => [
		'Content-Type' => $content_type,
		'Accept'       => 'application/json',
	],
	'body'    => $body,
];

to

$args     = [
	'method'  => $method,
	'headers' => [
		'Content-Type' => $content_type,
		'Accept'       => 'application/json',
		'API-TOKEN'	   => $credentials['key'],
	],
	'body'    => $body,
];

fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant