Class: VoucherifySdk::TemplatesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/api/templates_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TemplatesApi

Returns a new instance of TemplatesApi.



19
20
21
# File 'lib/VoucherifySdk/api/templates_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/VoucherifySdk/api/templates_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_tier_from_template(campaign_template_id, opts = {}) ⇒ TemplatesCampaignsTierSetupCreateResponseBody

Add Promotion Tier From Template Creates a promotion tier out of a discount campaign template and adds it to an existing promotion campaign. To add a promotion tier to a campaign, you need to provide the name in the request and the campaign ID. Other fields are optional. If no other fields are sent, the configuration from the template will be used. You can send new values of the fields listed below to replace the settings saved in the template. However, you cannot assign an action or an existing validation rule or create a new one in the request. If the template has a validation rule, a new validation rule is always created for the promotion tier. When the promotion tier has been created, then you can: - Update the validation rule, - Unassign the validation rule, - Assign an existing validation rule. 👍 Promotion Tiers and Campaign Templates You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the DISCOUNT_COUPON type. You can use this template to create: - Discount campaign - Promotion tier 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

Parameters:

  • campaign_template_id (String)

    Pass the campaign template ID that was assigned by Voucherify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



28
29
30
31
# File 'lib/VoucherifySdk/api/templates_api.rb', line 28

def add_tier_from_template(campaign_template_id, opts = {})
  data, _status_code, _headers = add_tier_from_template_with_http_info(campaign_template_id, opts)
  data
end

#create_campaign_from_template(campaign_template_id, opts = {}) ⇒ TemplatesCampaignsCampaignSetupCreateResponseBody

Create Campaign From Template Creates a campaign out of a campaign template. To create a campaign, you need to provide the name in the request, while other fields are optional. If no other fields are sent, the configuration from the template will be used. You can send new values of the fields listed below to replace the settings saved in the template. However, you cannot assign an existing validation rule or create a new one in the request. If the template has a validation rule, a new validation rule is always created for the campaign. When the campaign has been created, then you can: - Update the validation rule, - Unassign the validation rule, - Assign an existing validation rule. 👍 Promotion Tiers and Campaign Templates You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the DISCOUNT_COUPON type. You can use this template to create: - Discount campaign - Promotion tier 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

Parameters:

  • campaign_template_id (String)

    Pass the campaign template ID that was assigned by Voucherify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



94
95
96
97
# File 'lib/VoucherifySdk/api/templates_api.rb', line 94

def create_campaign_from_template(campaign_template_id, opts = {})
  data, _status_code, _headers = create_campaign_from_template_with_http_info(campaign_template_id, opts)
  data
end

#create_campaign_template(opts = {}) ⇒ TemplatesCampaignsCreateTemplateResponseBody

Create Campaign Template Creates a template for a discount or gift campaign, or a promotion tier. A template stores campaign configuration without the following details: - Campaign name - Category - Code count The following elements are not supported by campaign templates: - Redeeming API keys - Redeeming users - Customer loyalty tier - Static segments 👍 Promotion Tiers and Campaign Templates You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the DISCOUNT_COUPON type. You can use this template to create: - Discount campaign, - Promotion tier. 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



159
160
161
162
# File 'lib/VoucherifySdk/api/templates_api.rb', line 159

def create_campaign_template(opts = {})
  data, _status_code, _headers = create_campaign_template_with_http_info(opts)
  data
end

#delete_campaign_template(campaign_template_id, opts = {}) ⇒ nil

Delete Campaign Template Deletes the campaign template permanently. 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

Parameters:

  • campaign_template_id (String)

    Pass the campaign template ID that was assigned by Voucherify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


223
224
225
226
# File 'lib/VoucherifySdk/api/templates_api.rb', line 223

def delete_campaign_template(campaign_template_id, opts = {})
  delete_campaign_template_with_http_info(campaign_template_id, opts)
  nil
end

#get_campaign_template(campaign_template_id, opts = {}) ⇒ TemplatesCampaignsGetResponseBody

Get Campaign Template Retrieves a campaign template available in the project. 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

Parameters:

  • campaign_template_id (String)

    Pass the campaign template ID that was assigned by Voucherify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



280
281
282
283
# File 'lib/VoucherifySdk/api/templates_api.rb', line 280

def get_campaign_template(campaign_template_id, opts = {})
  data, _status_code, _headers = get_campaign_template_with_http_info(campaign_template_id, opts)
  data
end

#list_campaign_templates(opts = {}) ⇒ TemplatesCampaignsListResponseBody

List Campaign Templates Lists all campaign templates available in the project. 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

  • :starting_after_id (String)

    A cursor for pagination. It retrieves the campaign templates created after a template with the given ID.

  • :order (ParameterTemplatesList)

    Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

  • :include_total (Boolean)

    If set to true, the response returns the number of all campaign templates, regardless of the applied filters or limits. Set to false by default.

  • :filters (ParameterFiltersListTemplates)

    Filters for listing templates.

Returns:



343
344
345
346
# File 'lib/VoucherifySdk/api/templates_api.rb', line 343

def list_campaign_templates(opts = {})
  data, _status_code, _headers = list_campaign_templates_with_http_info(opts)
  data
end

#update_campaign_template(campaign_template_id, opts = {}) ⇒ TemplatesCampaignsUpdateResponseBody

Update Campaign Template Updates the name or description of the campaign template. 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

Parameters:

  • campaign_template_id (String)

    Pass the campaign template ID that was assigned by Voucherify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



412
413
414
415
# File 'lib/VoucherifySdk/api/templates_api.rb', line 412

def update_campaign_template(campaign_template_id, opts = {})
  data, _status_code, _headers = update_campaign_template_with_http_info(campaign_template_id, opts)
  data
end