Skip to content

ConvertKit_API::create_tag() does not support multiple tags creation #60

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

Closed
slaFFik opened this issue Apr 25, 2023 · 1 comment
Closed

Comments

@slaFFik
Copy link

slaFFik commented Apr 25, 2023

Is your feature request related to a problem?

CK API supports creating multiple tags in one go.
See API: https://developers.convertkit.com/#create-a-tag (note the Multiple tags example).

The \ConvertKit_API\ConvertKit_API::create_tag() method does not support this behavior allowing only a single tag per request to be created.

Describe the solution you'd like

Modify \ConvertKit_API\ConvertKit_API::create_tag() to support not just the string parameter as a single tag name, but also accepting an array OR always accepting an array (even with a single tag name).

Describe alternatives you've considered

I had to implement a copy of this method that basically does this:

$options = [ 'api_secret' => $this->api_secret ];

foreach ( $tag_labels as $label ) {
	$options['tag'][] = [ 'name' => $label ];
}

return $this->post( 'tags', $options );
@n7studios
Copy link
Contributor

Available with the create_tags() method in 1.1

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

2 participants