Skip to content

Add v4 API Key Support #105

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

Merged
merged 10 commits into from
Apr 7, 2025
Merged

Add v4 API Key Support #105

merged 10 commits into from
Apr 7, 2025

Conversation

n7studios
Copy link
Contributor

Summary

Resolves this reported issue, adding support for the named apiKey parameter on the ConvertKit_API class constructor.

Testing

Shared tests have been moved to tests/ConvertKitAPITest.php, with both ConvertKitAPIKeyTest and ConvertKitAPIOAuth tests inheriting them.

These two test classes override some specific tests as required (e.g. bulk endpoints are not supported using an API Key, so tests exist in ConvertKitAPIKeyTest for these to ensure a ClientException is thrown).

Checklist

@n7studios n7studios self-assigned this Mar 28, 2025
@n7studios n7studios requested review from a team, noelherrick and corydhmiller and removed request for a team April 3, 2025 10:39
@n7studios n7studios marked this pull request as ready for review April 3, 2025 10:40
*
* @return void
*/
public function testAddSubscribersToForms()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What value do you see with these tests as they appear to be testing whether or not the Kit API is throwing an exception vs. testing logic in this library? Or am I misunderstanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bulk API endpoints and purchases endpoints don't support using an API Key, and therefore rightly return an error - so these tests confirm that the PHP SDK throws a ClientException, which I think there's value in doing here.

@n7studios n7studios merged commit cfd050c into master Apr 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access for non-oauth apps
2 participants