Skip to content

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

@slaFFik

Description

@slaFFik

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 );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions