Class: PreludeSDK::Resources::Notify
- Inherits:
-
Object
- Object
- PreludeSDK::Resources::Notify
- Defined in:
- lib/prelude_sdk/resources/notify.rb,
sig/prelude_sdk/resources/notify.rbs
Overview
Send transactional and marketing messages with compliance enforcement.
Instance Method Summary collapse
-
#get_subscription_config(config_id, request_options: {}) ⇒ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse
Retrieve a specific subscription management configuration by its ID.
-
#get_subscription_phone_number(phone_number, config_id:, request_options: {}) ⇒ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse
Retrieve the current subscription status for a specific phone number within a subscription configuration.
-
#initialize(client:) ⇒ Notify
constructor
private
A new instance of Notify.
-
#list_subscription_configs(cursor: nil, limit: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyListSubscriptionConfigsResponse
Retrieve a paginated list of subscription management configurations for your account.
-
#list_subscription_phone_number_events(phone_number, config_id:, cursor: nil, limit: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse
Retrieve a paginated list of subscription events (status changes) for a specific phone number within a subscription configuration.
-
#list_subscription_phone_numbers(config_id, cursor: nil, limit: nil, state: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse
Retrieve a paginated list of phone numbers and their subscription statuses for a specific subscription configuration.
-
#reply(reply_to:, text:, to:, callback_url: nil, correlation_id: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyReplyResponse
Some parameter documentations has been truncated, see Models::NotifyReplyParams for more details.
-
#send_(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifySendResponse
Some parameter documentations has been truncated, see Models::NotifySendParams for more details.
-
#send_batch(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifySendBatchResponse
Some parameter documentations has been truncated, see Models::NotifySendBatchParams for more details.
Constructor Details
#initialize(client:) ⇒ Notify
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 Notify.
299 300 301 |
# File 'lib/prelude_sdk/resources/notify.rb', line 299 def initialize(client:) @client = client end |
Instance Method Details
#get_subscription_config(config_id, request_options: {}) ⇒ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse
Retrieve a specific subscription management configuration by its ID.
In order to get access to this endpoint, contact our support team.
20 21 22 23 24 25 26 27 |
# File 'lib/prelude_sdk/resources/notify.rb', line 20 def get_subscription_config(config_id, params = {}) @client.request( method: :get, path: ["v2/notify/management/subscriptions/%1$s", config_id], model: PreludeSDK::Models::NotifyGetSubscriptionConfigResponse, options: params[:request_options] ) end |
#get_subscription_phone_number(phone_number, config_id:, request_options: {}) ⇒ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse
Retrieve the current subscription status for a specific phone number within a subscription configuration.
In order to get access to this endpoint, contact our support team.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/prelude_sdk/resources/notify.rb', line 45 def get_subscription_phone_number(phone_number, params) parsed, = PreludeSDK::NotifyGetSubscriptionPhoneNumberParams.dump_request(params) config_id = parsed.delete(:config_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v2/notify/management/subscriptions/%1$s/phone_numbers/%2$s", config_id, phone_number], model: PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse, options: ) end |
#list_subscription_configs(cursor: nil, limit: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyListSubscriptionConfigsResponse
Retrieve a paginated list of subscription management configurations for your account.
Each configuration represents a subscription management setup with phone numbers for receiving opt-out/opt-in requests and a callback URL for webhook events.
In order to get access to this endpoint, contact our support team.
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/prelude_sdk/resources/notify.rb', line 78 def list_subscription_configs(params = {}) parsed, = PreludeSDK::NotifyListSubscriptionConfigsParams.dump_request(params) query = PreludeSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/notify/management/subscriptions", query: query, model: PreludeSDK::Models::NotifyListSubscriptionConfigsResponse, options: ) end |
#list_subscription_phone_number_events(phone_number, config_id:, cursor: nil, limit: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse
Retrieve a paginated list of subscription events (status changes) for a specific phone number within a subscription configuration.
Events are ordered by timestamp in descending order (most recent first).
In order to get access to this endpoint, contact our support team.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/prelude_sdk/resources/notify.rb', line 112 def list_subscription_phone_number_events(phone_number, params) parsed, = PreludeSDK::NotifyListSubscriptionPhoneNumberEventsParams.dump_request(params) query = PreludeSDK::Internal::Util.encode_query_params(parsed) config_id = parsed.delete(:config_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: [ "v2/notify/management/subscriptions/%1$s/phone_numbers/%2$s/events", config_id, phone_number ], query: query, model: PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse, options: ) end |
#list_subscription_phone_numbers(config_id, cursor: nil, limit: nil, state: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse
Retrieve a paginated list of phone numbers and their subscription statuses for a specific subscription configuration.
You can optionally filter by subscription state (SUB or UNSUB).
In order to get access to this endpoint, contact our support team.
154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/prelude_sdk/resources/notify.rb', line 154 def list_subscription_phone_numbers(config_id, params = {}) parsed, = PreludeSDK::NotifyListSubscriptionPhoneNumbersParams.dump_request(params) query = PreludeSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v2/notify/management/subscriptions/%1$s/phone_numbers", config_id], query: query, model: PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse, options: ) end |
#reply(reply_to:, text:, to:, callback_url: nil, correlation_id: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifyReplyResponse
Some parameter documentations has been truncated, see Models::NotifyReplyParams for more details.
Send a free-form text reply to an inbound WhatsApp message within the 24-hour conversation window. See WhatsApp 2-Way Messaging for details.
190 191 192 193 194 195 196 197 198 199 |
# File 'lib/prelude_sdk/resources/notify.rb', line 190 def reply(params) parsed, = PreludeSDK::NotifyReplyParams.dump_request(params) @client.request( method: :post, path: "v2/notify/reply", body: parsed, model: PreludeSDK::Models::NotifyReplyResponse, options: ) end |
#send_(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifySendResponse
Some parameter documentations has been truncated, see Models::NotifySendParams for more details.
Send transactional and marketing messages to your users via SMS, RCS and WhatsApp with automatic compliance enforcement.
238 239 240 241 242 243 244 245 246 247 |
# File 'lib/prelude_sdk/resources/notify.rb', line 238 def send_(params) parsed, = PreludeSDK::NotifySendParams.dump_request(params) @client.request( method: :post, path: "v2/notify", body: parsed, model: PreludeSDK::Models::NotifySendResponse, options: ) end |
#send_batch(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {}) ⇒ PreludeSDK::Models::NotifySendBatchResponse
Some parameter documentations has been truncated, see Models::NotifySendBatchParams for more details.
Send the same message to multiple recipients in a single request.
285 286 287 288 289 290 291 292 293 294 |
# File 'lib/prelude_sdk/resources/notify.rb', line 285 def send_batch(params) parsed, = PreludeSDK::NotifySendBatchParams.dump_request(params) @client.request( method: :post, path: "v2/notify/batch", body: parsed, model: PreludeSDK::Models::NotifySendBatchResponse, options: ) end |