Class: Telnyx::Resources::Whatsapp::Templates
- Inherits:
-
Object
- Object
- Telnyx::Resources::Whatsapp::Templates
- Defined in:
- lib/telnyx/resources/whatsapp/templates.rb,
sig/telnyx/resources/whatsapp/templates.rbs
Overview
Manage Whatsapp message templates
Instance Method Summary collapse
-
#create(category:, components:, language:, name:, waba_id:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::TemplateCreateResponse
Some parameter documentations has been truncated, see Models::Whatsapp::TemplateCreateParams for more details.
-
#initialize(client:) ⇒ Templates
constructor
private
A new instance of Templates.
-
#list(filter_category: nil, filter_search: nil, filter_status: nil, filter_waba_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::WhatsappTemplateData>
Returns WhatsApp message templates owned by the authenticated account, including their current review state.
Constructor Details
#initialize(client:) ⇒ Templates
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Templates.
87 88 89 |
# File 'lib/telnyx/resources/whatsapp/templates.rb', line 87 def initialize(client:) @client = client end |
Instance Method Details
#create(category:, components:, language:, name:, waba_id:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::TemplateCreateResponse
Some parameter documentations has been truncated, see Models::Whatsapp::TemplateCreateParams for more details.
Creates a WhatsApp message template for review and subsequent use in template messages.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/telnyx/resources/whatsapp/templates.rb', line 31 def create(params) parsed, = Telnyx::Whatsapp::TemplateCreateParams.dump_request(params) @client.request( method: :post, path: "v2/whatsapp/message_templates", body: parsed, model: Telnyx::Models::Whatsapp::TemplateCreateResponse, options: ) end |
#list(filter_category: nil, filter_search: nil, filter_status: nil, filter_waba_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::WhatsappTemplateData>
Returns WhatsApp message templates owned by the authenticated account, including their current review state.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/telnyx/resources/whatsapp/templates.rb', line 64 def list(params = {}) parsed, = Telnyx::Whatsapp::TemplateListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/whatsapp/message_templates", query: query.transform_keys( filter_category: "filter[category]", filter_search: "filter[search]", filter_status: "filter[status]", filter_waba_id: "filter[waba_id]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::WhatsappTemplateData, options: ) end |