sendly 3.40.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +138 -1
- data/Gemfile.lock +3 -3
- data/README.md +153 -0
- data/lib/sendly/account_resource.rb +4 -4
- data/lib/sendly/calls_resource.rb +409 -0
- data/lib/sendly/campaigns_resource.rb +8 -8
- data/lib/sendly/client.rb +7 -0
- data/lib/sendly/contacts_resource.rb +9 -9
- data/lib/sendly/enterprise.rb +26 -26
- data/lib/sendly/numbers_resource.rb +22 -2
- data/lib/sendly/templates_resource.rb +6 -6
- data/lib/sendly/verify.rb +3 -3
- data/lib/sendly/version.rb +1 -1
- data/lib/sendly/webhooks.rb +4 -0
- data/lib/sendly/webhooks_resource.rb +10 -10
- data/lib/sendly.rb +1 -0
- metadata +3 -2
data/lib/sendly/enterprise.rb
CHANGED
|
@@ -22,13 +22,13 @@ module Sendly
|
|
|
22
22
|
def get(workspace_id)
|
|
23
23
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
24
24
|
|
|
25
|
-
@client.get("/enterprise/workspaces/#{workspace_id}")
|
|
25
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}")
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def delete(workspace_id)
|
|
29
29
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
30
30
|
|
|
31
|
-
@client.delete("/enterprise/workspaces/#{workspace_id}")
|
|
31
|
+
@client.delete("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}")
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Submit (or resubmit) a verification for an enterprise workspace.
|
|
@@ -89,7 +89,7 @@ module Sendly
|
|
|
89
89
|
body[:privacyUrl] = privacy_url unless privacy_url.nil?
|
|
90
90
|
body[:termsUrl] = terms_url unless terms_url.nil?
|
|
91
91
|
|
|
92
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/verification/submit", body)
|
|
92
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/verification/submit", body)
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
# Convenience alias for resubmits. Identical to +submit_verification+
|
|
@@ -106,7 +106,7 @@ module Sendly
|
|
|
106
106
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
107
107
|
raise ArgumentError, "Source workspace ID is required" if source_workspace_id.nil? || source_workspace_id.empty?
|
|
108
108
|
|
|
109
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/verification/inherit", {
|
|
109
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/verification/inherit", {
|
|
110
110
|
source_workspace_id: source_workspace_id
|
|
111
111
|
})
|
|
112
112
|
end
|
|
@@ -114,7 +114,7 @@ module Sendly
|
|
|
114
114
|
def get_verification(workspace_id)
|
|
115
115
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
116
116
|
|
|
117
|
-
@client.get("/enterprise/workspaces/#{workspace_id}/verification")
|
|
117
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/verification")
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
def transfer_credits(workspace_id, source_workspace_id:, amount:)
|
|
@@ -122,7 +122,7 @@ module Sendly
|
|
|
122
122
|
raise ArgumentError, "Source workspace ID is required" if source_workspace_id.nil? || source_workspace_id.empty?
|
|
123
123
|
raise ArgumentError, "Amount must be a positive number" if !amount.is_a?(Integer) || amount <= 0
|
|
124
124
|
|
|
125
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/transfer-credits", {
|
|
125
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/transfer-credits", {
|
|
126
126
|
source_workspace_id: source_workspace_id,
|
|
127
127
|
amount: amount
|
|
128
128
|
})
|
|
@@ -131,7 +131,7 @@ module Sendly
|
|
|
131
131
|
def get_credits(workspace_id)
|
|
132
132
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
133
133
|
|
|
134
|
-
@client.get("/enterprise/workspaces/#{workspace_id}/credits")
|
|
134
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/credits")
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
def create_key(workspace_id, name: nil, type: nil)
|
|
@@ -141,26 +141,26 @@ module Sendly
|
|
|
141
141
|
body[:name] = name if name
|
|
142
142
|
body[:type] = type if type
|
|
143
143
|
|
|
144
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/keys", body)
|
|
144
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/keys", body)
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
def list_keys(workspace_id)
|
|
148
148
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
149
149
|
|
|
150
|
-
@client.get("/enterprise/workspaces/#{workspace_id}/keys")
|
|
150
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/keys")
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
def revoke_key(workspace_id, key_id)
|
|
154
154
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
155
155
|
raise ArgumentError, "Key ID is required" if key_id.nil? || key_id.empty?
|
|
156
156
|
|
|
157
|
-
@client.delete("/enterprise/workspaces/#{workspace_id}/keys/#{key_id}")
|
|
157
|
+
@client.delete("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/keys/#{URI.encode_www_form_component(key_id)}")
|
|
158
158
|
end
|
|
159
159
|
|
|
160
160
|
def list_opt_in_pages(workspace_id)
|
|
161
161
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
162
162
|
|
|
163
|
-
@client.get("/enterprise/workspaces/#{workspace_id}/opt-in-pages")
|
|
163
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/opt-in-pages")
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
def create_opt_in_page(workspace_id, business_name:, use_case: nil, use_case_summary: nil, sample_messages: nil)
|
|
@@ -172,7 +172,7 @@ module Sendly
|
|
|
172
172
|
body[:useCaseSummary] = use_case_summary if use_case_summary
|
|
173
173
|
body[:sampleMessages] = sample_messages if sample_messages
|
|
174
174
|
|
|
175
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/opt-in-pages", body)
|
|
175
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/opt-in-pages", body)
|
|
176
176
|
end
|
|
177
177
|
|
|
178
178
|
def update_opt_in_page(workspace_id, page_id, logo_url: nil, header_color: nil, button_color: nil, custom_headline: nil, custom_benefits: nil)
|
|
@@ -186,14 +186,14 @@ module Sendly
|
|
|
186
186
|
body[:customHeadline] = custom_headline unless custom_headline.nil?
|
|
187
187
|
body[:customBenefits] = custom_benefits unless custom_benefits.nil?
|
|
188
188
|
|
|
189
|
-
@client.patch("/enterprise/workspaces/#{workspace_id}/opt-in-pages/#{page_id}", body)
|
|
189
|
+
@client.patch("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/opt-in-pages/#{URI.encode_www_form_component(page_id)}", body)
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
def delete_opt_in_page(workspace_id, page_id)
|
|
193
193
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
194
194
|
raise ArgumentError, "Page ID is required" if page_id.nil? || page_id.empty?
|
|
195
195
|
|
|
196
|
-
@client.delete("/enterprise/workspaces/#{workspace_id}/opt-in-pages/#{page_id}")
|
|
196
|
+
@client.delete("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/opt-in-pages/#{URI.encode_www_form_component(page_id)}")
|
|
197
197
|
end
|
|
198
198
|
|
|
199
199
|
def set_webhook(workspace_id, url:, events: nil, description: nil)
|
|
@@ -204,19 +204,19 @@ module Sendly
|
|
|
204
204
|
body[:events] = events if events
|
|
205
205
|
body[:description] = description if description
|
|
206
206
|
|
|
207
|
-
@client.put("/enterprise/workspaces/#{workspace_id}/webhooks", body)
|
|
207
|
+
@client.put("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/webhooks", body)
|
|
208
208
|
end
|
|
209
209
|
|
|
210
210
|
def list_webhooks(workspace_id)
|
|
211
211
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
212
212
|
|
|
213
|
-
@client.get("/enterprise/workspaces/#{workspace_id}/webhooks")
|
|
213
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/webhooks")
|
|
214
214
|
end
|
|
215
215
|
|
|
216
216
|
def delete_webhooks(workspace_id, webhook_id: nil)
|
|
217
217
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
218
218
|
|
|
219
|
-
path = "/enterprise/workspaces/#{workspace_id}/webhooks"
|
|
219
|
+
path = "/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/webhooks"
|
|
220
220
|
path += "?webhookId=#{webhook_id}" if webhook_id
|
|
221
221
|
|
|
222
222
|
@client.delete(path)
|
|
@@ -225,7 +225,7 @@ module Sendly
|
|
|
225
225
|
def test_webhook(workspace_id)
|
|
226
226
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
227
227
|
|
|
228
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/webhooks/test")
|
|
228
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/webhooks/test")
|
|
229
229
|
end
|
|
230
230
|
|
|
231
231
|
def suspend(workspace_id, reason: nil)
|
|
@@ -234,13 +234,13 @@ module Sendly
|
|
|
234
234
|
body = {}
|
|
235
235
|
body[:reason] = reason if reason
|
|
236
236
|
|
|
237
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/suspend", body)
|
|
237
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/suspend", body)
|
|
238
238
|
end
|
|
239
239
|
|
|
240
240
|
def resume(workspace_id)
|
|
241
241
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
242
242
|
|
|
243
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/resume")
|
|
243
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/resume")
|
|
244
244
|
end
|
|
245
245
|
|
|
246
246
|
def provision_bulk(workspaces)
|
|
@@ -255,7 +255,7 @@ module Sendly
|
|
|
255
255
|
raise ArgumentError, "Page ID is required" if page_id.nil? || page_id.empty?
|
|
256
256
|
raise ArgumentError, "Domain is required" if domain.nil? || domain.empty?
|
|
257
257
|
|
|
258
|
-
@client.put("/enterprise/workspaces/#{workspace_id}/pages/#{page_id}/domain", { domain: domain })
|
|
258
|
+
@client.put("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/pages/#{URI.encode_www_form_component(page_id)}/domain", { domain: domain })
|
|
259
259
|
end
|
|
260
260
|
|
|
261
261
|
def send_invitation(workspace_id, email:, role:)
|
|
@@ -263,7 +263,7 @@ module Sendly
|
|
|
263
263
|
raise ArgumentError, "Email is required" if email.nil? || email.empty?
|
|
264
264
|
raise ArgumentError, "Role is required" if role.nil? || role.empty?
|
|
265
265
|
|
|
266
|
-
@client.post("/enterprise/workspaces/#{workspace_id}/invitations", {
|
|
266
|
+
@client.post("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/invitations", {
|
|
267
267
|
email: email,
|
|
268
268
|
role: role
|
|
269
269
|
})
|
|
@@ -272,26 +272,26 @@ module Sendly
|
|
|
272
272
|
def list_invitations(workspace_id)
|
|
273
273
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
274
274
|
|
|
275
|
-
@client.get("/enterprise/workspaces/#{workspace_id}/invitations")
|
|
275
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/invitations")
|
|
276
276
|
end
|
|
277
277
|
|
|
278
278
|
def cancel_invitation(workspace_id, invite_id)
|
|
279
279
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
280
280
|
raise ArgumentError, "Invite ID is required" if invite_id.nil? || invite_id.empty?
|
|
281
281
|
|
|
282
|
-
@client.delete("/enterprise/workspaces/#{workspace_id}/invitations/#{invite_id}")
|
|
282
|
+
@client.delete("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/invitations/#{URI.encode_www_form_component(invite_id)}")
|
|
283
283
|
end
|
|
284
284
|
|
|
285
285
|
def get_quota(workspace_id)
|
|
286
286
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
287
287
|
|
|
288
|
-
@client.get("/enterprise/workspaces/#{workspace_id}/quota")
|
|
288
|
+
@client.get("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/quota")
|
|
289
289
|
end
|
|
290
290
|
|
|
291
291
|
def set_quota(workspace_id, monthly_message_quota:)
|
|
292
292
|
raise ArgumentError, "Workspace ID is required" if workspace_id.nil? || workspace_id.empty?
|
|
293
293
|
|
|
294
|
-
@client.put("/enterprise/workspaces/#{workspace_id}/quota", {
|
|
294
|
+
@client.put("/enterprise/workspaces/#{URI.encode_www_form_component(workspace_id)}/quota", {
|
|
295
295
|
monthlyMessageQuota: monthly_message_quota
|
|
296
296
|
})
|
|
297
297
|
end
|
|
@@ -53,9 +53,21 @@ module Sendly
|
|
|
53
53
|
# true when the number is scheduled for release at period end.
|
|
54
54
|
:pending_cancellation,
|
|
55
55
|
# ISO-8601 timestamp string, or nil when no release is scheduled.
|
|
56
|
-
:scheduled_release_at
|
|
56
|
+
:scheduled_release_at,
|
|
57
|
+
# true when the number can place and receive phone calls
|
|
58
|
+
# (switched on in the dashboard under Calls, then Settings).
|
|
59
|
+
:voice_enabled,
|
|
60
|
+
# One of {VOICE_MODES}: "none" when voice is off, "ring_dashboard"
|
|
61
|
+
# when inbound calls ring the team, "agent" when an AI agent answers.
|
|
62
|
+
:voice_mode
|
|
63
|
+
|
|
64
|
+
# @return [Hash] The raw parsed response
|
|
65
|
+
attr_reader :raw
|
|
66
|
+
|
|
67
|
+
VOICE_MODES = %w[none ring_dashboard agent].freeze
|
|
57
68
|
|
|
58
69
|
def initialize(data)
|
|
70
|
+
@raw = data
|
|
59
71
|
@id = data["id"]
|
|
60
72
|
@phone_number = data["phoneNumber"] || data["phone_number"]
|
|
61
73
|
@status = data["status"]
|
|
@@ -67,6 +79,13 @@ module Sendly
|
|
|
67
79
|
@requirements_submitted_at = data["requirementsSubmittedAt"] || data["requirements_submitted_at"]
|
|
68
80
|
@pending_cancellation = data.key?("pendingCancellation") ? data["pendingCancellation"] : data["pending_cancellation"]
|
|
69
81
|
@scheduled_release_at = data["scheduledReleaseAt"] || data["scheduled_release_at"]
|
|
82
|
+
@voice_enabled = data.key?("voiceEnabled") ? data["voiceEnabled"] : data["voice_enabled"]
|
|
83
|
+
@voice_mode = data["voiceMode"] || data["voice_mode"]
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# @return [Boolean] Whether the number can be used as the +from+ of a call
|
|
87
|
+
def voice_enabled?
|
|
88
|
+
voice_enabled == true
|
|
70
89
|
end
|
|
71
90
|
|
|
72
91
|
def to_h
|
|
@@ -76,7 +95,8 @@ module Sendly
|
|
|
76
95
|
monthly_cost_cents: monthly_cost_cents, is_default: is_default,
|
|
77
96
|
requirements_submitted_at: requirements_submitted_at,
|
|
78
97
|
pending_cancellation: pending_cancellation,
|
|
79
|
-
scheduled_release_at: scheduled_release_at
|
|
98
|
+
scheduled_release_at: scheduled_release_at,
|
|
99
|
+
voice_enabled: voice_enabled, voice_mode: voice_mode
|
|
80
100
|
}.compact
|
|
81
101
|
end
|
|
82
102
|
end
|
|
@@ -129,7 +129,7 @@ module Sendly
|
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
def get(id)
|
|
132
|
-
response = @client.get("/templates/#{id}")
|
|
132
|
+
response = @client.get("/templates/#{URI.encode_www_form_component(id)}")
|
|
133
133
|
Template.new(response)
|
|
134
134
|
end
|
|
135
135
|
|
|
@@ -198,16 +198,16 @@ module Sendly
|
|
|
198
198
|
request_body[:name] = name if name
|
|
199
199
|
request_body[:text] = content if content
|
|
200
200
|
|
|
201
|
-
response = @client.patch("/templates/#{id}", request_body)
|
|
201
|
+
response = @client.patch("/templates/#{URI.encode_www_form_component(id)}", request_body)
|
|
202
202
|
Template.new(response)
|
|
203
203
|
end
|
|
204
204
|
|
|
205
205
|
def delete(id)
|
|
206
|
-
@client.delete("/templates/#{id}")
|
|
206
|
+
@client.delete("/templates/#{URI.encode_www_form_component(id)}")
|
|
207
207
|
end
|
|
208
208
|
|
|
209
209
|
def publish(id)
|
|
210
|
-
response = @client.post("/templates/#{id}/publish")
|
|
210
|
+
response = @client.post("/templates/#{URI.encode_www_form_component(id)}/publish")
|
|
211
211
|
Template.new(response)
|
|
212
212
|
end
|
|
213
213
|
|
|
@@ -217,7 +217,7 @@ module Sendly
|
|
|
217
217
|
# this call fails with a 404. To retire a published template today,
|
|
218
218
|
# {#create} and {#publish} a replacement, then {#delete} this one.
|
|
219
219
|
def unpublish(id)
|
|
220
|
-
response = @client.post("/templates/#{id}/unpublish")
|
|
220
|
+
response = @client.post("/templates/#{URI.encode_www_form_component(id)}/unpublish")
|
|
221
221
|
Template.new(response)
|
|
222
222
|
end
|
|
223
223
|
|
|
@@ -229,7 +229,7 @@ module Sendly
|
|
|
229
229
|
def clone(id, name: nil)
|
|
230
230
|
body = {}
|
|
231
231
|
body[:name] = name if name
|
|
232
|
-
response = @client.post("/templates/#{id}/clone", body)
|
|
232
|
+
response = @client.post("/templates/#{URI.encode_www_form_component(id)}/clone", body)
|
|
233
233
|
Template.new(response)
|
|
234
234
|
end
|
|
235
235
|
|
data/lib/sendly/verify.rb
CHANGED
|
@@ -181,17 +181,17 @@ module Sendly
|
|
|
181
181
|
end
|
|
182
182
|
|
|
183
183
|
def resend(id)
|
|
184
|
-
response = @client.post("/verify/#{id}/resend")
|
|
184
|
+
response = @client.post("/verify/#{URI.encode_www_form_component(id)}/resend")
|
|
185
185
|
SendVerificationResponse.new(response)
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
def check(id, code:)
|
|
189
|
-
response = @client.post("/verify/#{id}/check", { code: code })
|
|
189
|
+
response = @client.post("/verify/#{URI.encode_www_form_component(id)}/check", { code: code })
|
|
190
190
|
CheckVerificationResponse.new(response)
|
|
191
191
|
end
|
|
192
192
|
|
|
193
193
|
def get(id)
|
|
194
|
-
response = @client.get("/verify/#{id}")
|
|
194
|
+
response = @client.get("/verify/#{URI.encode_www_form_component(id)}")
|
|
195
195
|
Verification.new(response)
|
|
196
196
|
end
|
|
197
197
|
|
data/lib/sendly/version.rb
CHANGED
data/lib/sendly/webhooks.rb
CHANGED
|
@@ -99,6 +99,10 @@ module Sendly
|
|
|
99
99
|
EVENT_CALL_STARTED = "call.started"
|
|
100
100
|
EVENT_CALL_COMPLETED = "call.completed"
|
|
101
101
|
EVENT_CALL_RECORDING_READY = "call.recording.ready"
|
|
102
|
+
EVENT_SHORT_CODE_ACTION_REQUIRED = "short_code.action_required"
|
|
103
|
+
EVENT_SHORT_CODE_REJECTED = "short_code.rejected"
|
|
104
|
+
EVENT_SHORT_CODE_FILED = "short_code.filed"
|
|
105
|
+
EVENT_SHORT_CODE_LIVE = "short_code.live"
|
|
102
106
|
|
|
103
107
|
# Source of a list-health event. Frozen enum — new values will be
|
|
104
108
|
# added in minor SDK versions, never removed.
|
|
@@ -51,7 +51,7 @@ module Sendly
|
|
|
51
51
|
# @return [Sendly::Webhook]
|
|
52
52
|
def get(webhook_id)
|
|
53
53
|
validate_webhook_id!(webhook_id)
|
|
54
|
-
response = @client.get("/webhooks/#{webhook_id}")
|
|
54
|
+
response = @client.get("/webhooks/#{URI.encode_www_form_component(webhook_id)}")
|
|
55
55
|
Webhook.new(response)
|
|
56
56
|
end
|
|
57
57
|
|
|
@@ -77,7 +77,7 @@ module Sendly
|
|
|
77
77
|
body[:mode] = mode unless mode.nil?
|
|
78
78
|
body[:metadata] = metadata unless metadata.nil?
|
|
79
79
|
|
|
80
|
-
response = @client.patch("/webhooks/#{webhook_id}", body)
|
|
80
|
+
response = @client.patch("/webhooks/#{URI.encode_www_form_component(webhook_id)}", body)
|
|
81
81
|
Webhook.new(response)
|
|
82
82
|
end
|
|
83
83
|
|
|
@@ -87,7 +87,7 @@ module Sendly
|
|
|
87
87
|
# @return [void]
|
|
88
88
|
def delete(webhook_id)
|
|
89
89
|
validate_webhook_id!(webhook_id)
|
|
90
|
-
@client.delete("/webhooks/#{webhook_id}")
|
|
90
|
+
@client.delete("/webhooks/#{URI.encode_www_form_component(webhook_id)}")
|
|
91
91
|
nil
|
|
92
92
|
end
|
|
93
93
|
|
|
@@ -97,7 +97,7 @@ module Sendly
|
|
|
97
97
|
# @return [Sendly::WebhookTestResult]
|
|
98
98
|
def test(webhook_id)
|
|
99
99
|
validate_webhook_id!(webhook_id)
|
|
100
|
-
response = @client.post("/webhooks/#{webhook_id}/test")
|
|
100
|
+
response = @client.post("/webhooks/#{URI.encode_www_form_component(webhook_id)}/test")
|
|
101
101
|
WebhookTestResult.new(response)
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -107,7 +107,7 @@ module Sendly
|
|
|
107
107
|
# @return [Hash] Reset confirmation with updated webhook
|
|
108
108
|
def reset_circuit(webhook_id)
|
|
109
109
|
validate_webhook_id!(webhook_id)
|
|
110
|
-
@client.post("/webhooks/#{webhook_id}/reset-circuit")
|
|
110
|
+
@client.post("/webhooks/#{URI.encode_www_form_component(webhook_id)}/reset-circuit")
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
# Replay failed or cancelled webhook deliveries from the audit log.
|
|
@@ -133,7 +133,7 @@ module Sendly
|
|
|
133
133
|
body[:event_types] = event_types unless event_types.nil?
|
|
134
134
|
body[:statuses] = statuses unless statuses.nil?
|
|
135
135
|
body[:limit] = limit unless limit.nil?
|
|
136
|
-
@client.post("/webhooks/#{webhook_id}/redeliver", body)
|
|
136
|
+
@client.post("/webhooks/#{URI.encode_www_form_component(webhook_id)}/redeliver", body)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
# Backfill missed webhook events from the underlying message log.
|
|
@@ -157,7 +157,7 @@ module Sendly
|
|
|
157
157
|
body[:until] = until_ unless until_.nil?
|
|
158
158
|
body[:event_types] = event_types unless event_types.nil?
|
|
159
159
|
body[:limit] = limit unless limit.nil?
|
|
160
|
-
@client.post("/webhooks/#{webhook_id}/backfill", body)
|
|
160
|
+
@client.post("/webhooks/#{URI.encode_www_form_component(webhook_id)}/backfill", body)
|
|
161
161
|
end
|
|
162
162
|
|
|
163
163
|
# Rotate the webhook signing secret
|
|
@@ -166,7 +166,7 @@ module Sendly
|
|
|
166
166
|
# @return [Sendly::WebhookSecretRotation]
|
|
167
167
|
def rotate_secret(webhook_id)
|
|
168
168
|
validate_webhook_id!(webhook_id)
|
|
169
|
-
response = @client.post("/webhooks/#{webhook_id}/rotate-secret")
|
|
169
|
+
response = @client.post("/webhooks/#{URI.encode_www_form_component(webhook_id)}/rotate-secret")
|
|
170
170
|
WebhookSecretRotation.new(response)
|
|
171
171
|
end
|
|
172
172
|
|
|
@@ -176,7 +176,7 @@ module Sendly
|
|
|
176
176
|
# @return [Array<Sendly::WebhookDelivery>]
|
|
177
177
|
def deliveries(webhook_id)
|
|
178
178
|
validate_webhook_id!(webhook_id)
|
|
179
|
-
response = @client.get("/webhooks/#{webhook_id}/deliveries")
|
|
179
|
+
response = @client.get("/webhooks/#{URI.encode_www_form_component(webhook_id)}/deliveries")
|
|
180
180
|
response.map { |data| WebhookDelivery.new(data) }
|
|
181
181
|
end
|
|
182
182
|
|
|
@@ -188,7 +188,7 @@ module Sendly
|
|
|
188
188
|
def retry_delivery(webhook_id, delivery_id)
|
|
189
189
|
validate_webhook_id!(webhook_id)
|
|
190
190
|
validate_delivery_id!(delivery_id)
|
|
191
|
-
@client.post("/webhooks/#{webhook_id}/deliveries/#{delivery_id}/retry")
|
|
191
|
+
@client.post("/webhooks/#{URI.encode_www_form_component(webhook_id)}/deliveries/#{URI.encode_www_form_component(delivery_id)}/retry")
|
|
192
192
|
nil
|
|
193
193
|
end
|
|
194
194
|
|
data/lib/sendly.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sendly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sendly
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -126,6 +126,7 @@ files:
|
|
|
126
126
|
- lib/sendly.rb
|
|
127
127
|
- lib/sendly/account_resource.rb
|
|
128
128
|
- lib/sendly/business_upgrade_resource.rb
|
|
129
|
+
- lib/sendly/calls_resource.rb
|
|
129
130
|
- lib/sendly/campaigns_resource.rb
|
|
130
131
|
- lib/sendly/client.rb
|
|
131
132
|
- lib/sendly/contacts_resource.rb
|