voicetel 2.2.16 → 2.2.17
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/README.md +10 -10
- data/lib/voicetel/models/i_numbering.rb +3 -1
- data/lib/voicetel/models/numbers.rb +23 -9
- data/lib/voicetel/version.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 437a8240b4ed4d919e23e9ef697a0d3f6e850567e687024c9c77c2323d76d3ef
|
|
4
|
+
data.tar.gz: 7d3da488bc91fe353049d2bd58d575a192b9c324b99f3c961fa50b339641ed07
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 17bb4b822a0250b2b5d95edb1f2bb020e988cba2e4ab74dc8b198e73af64d393f85355d290926102b4b0e557e86063f997e36487865a13331ac3cb106878e758
|
|
7
|
+
data.tar.gz: 3ab27ba58ecfeb51377e705dc2442d6e1c088e838ac97f6b2b5a749149e133d74ded36bc40614aa0e3db85ab1314de93bbb392273b87eda1bb493e711f0cdd81
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The official Ruby client for the [VoiceTel REST API](https://voicetel.com/docs/api/v2.2/) — provision numbers, place orders, validate e911, send messages, and manage your account, all with idiomatic Ruby, structured errors, and zero codegen footprint.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|

|
|
7
7
|

|
|
8
8
|

|
|
@@ -64,7 +64,7 @@ gem install voicetel
|
|
|
64
64
|
Or in your `Gemfile`:
|
|
65
65
|
|
|
66
66
|
```ruby
|
|
67
|
-
gem "voicetel", "~> 2.2.
|
|
67
|
+
gem "voicetel", "~> 2.2.17"
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
Requires Ruby 3.2 or later. Tested on 3.2, 3.3, and 3.4.
|
|
@@ -123,23 +123,23 @@ key = client.login(username: "1000000001", password: "hunter2")
|
|
|
123
123
|
| `client.e911` | Records, address validation, provisioning | `client.e911.validate(address1: "...", city: "...", state: "NJ", zip: "07101")` |
|
|
124
124
|
| `client.gateways` | Termination routes | `client.gateways.list` |
|
|
125
125
|
| `client.i_numbering` | Inventory, orders, port-ins | `client.i_numbering.search_inventory(tn_mask: "201555*")` |
|
|
126
|
-
| `client.lookups` | CNAM & LRN dips | `client.lookups.lrn("
|
|
126
|
+
| `client.lookups` | CNAM & LRN dips | `client.lookups.lrn("2015550123", "2015550100")` |
|
|
127
127
|
| `client.messaging` | SMS/MMS, 10DLC brands & campaigns, messaging health | `client.messaging.send_message(from_number: "...", to_number: "...", text: "...")` |
|
|
128
|
-
| `client.numbers` | All operations on TNs on the account | `client.numbers.assign_campaign("
|
|
128
|
+
| `client.numbers` | All operations on TNs on the account | `client.numbers.assign_campaign("2015550123", campaign_id: "CABC123")` |
|
|
129
129
|
| `client.support` | Tickets, replies, attachments | `client.support.create(subject: "...", message: "...")` |
|
|
130
130
|
|
|
131
131
|
Every method that takes a body accepts a plain Ruby Hash with `snake_case` keys; the SDK camelCases them when serializing to JSON:
|
|
132
132
|
|
|
133
133
|
```ruby
|
|
134
134
|
client.messaging.send_message(
|
|
135
|
-
from_number: "
|
|
136
|
-
to_number: "
|
|
135
|
+
from_number: "2015550100",
|
|
136
|
+
to_number: "2015550123",
|
|
137
137
|
text: "Your code is 482917"
|
|
138
138
|
)
|
|
139
|
-
# → POST /v2.2/messages { "fromNumber": "
|
|
139
|
+
# → POST /v2.2/messages { "fromNumber": "2015550100", "toNumber": "2015550123", "text": "Your code is 482917" }
|
|
140
140
|
|
|
141
|
-
client.numbers.assign_campaign("
|
|
142
|
-
# → PUT /v2.2/numbers/
|
|
141
|
+
client.numbers.assign_campaign("2015550123", campaign_id: "CABC123")
|
|
142
|
+
# → PUT /v2.2/numbers/2015550123/messaging-campaign { "campaignId": "CABC123" }
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
Responses come back as immutable `Data` model classes (`VoiceTel::Models::...`) with `snake_case` readers — `assign_campaign` returns a `Models::NumberMessagingCampaignAssignData` whose `status` is `"enabled"` (bound now, path B), `"already"` (was already bound — idempotent), or `"pending"` (path C, provisioning asynchronously — poll `client.numbers.get_messaging(n).pending` until its `state` is `"done"` or `"failed"`). Any model converts to a plain Hash with `#to_h` when you need to serialize or pretty-print it.
|
|
@@ -221,7 +221,7 @@ gem build voicetel.gemspec
|
|
|
221
221
|
|
|
222
222
|
## 🙌 Contributors
|
|
223
223
|
|
|
224
|
-
- [
|
|
224
|
+
- [Jane Doe](https://github.com/mavroudis) — Lead Developer
|
|
225
225
|
|
|
226
226
|
Contributions welcome. Open an issue describing the change you want to make, or send a pull request against `main`.
|
|
227
227
|
|
|
@@ -11,7 +11,9 @@ module VoiceTel
|
|
|
11
11
|
include Request
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# Per-number routing override inside OrderCreateRequest.
|
|
14
|
+
# Per-number routing override inside OrderCreateRequest. route is the
|
|
15
|
+
# global route type for numbers in this order: 1 USER, 2 T30,
|
|
16
|
+
# 3 VOICE_BRIDGE, 4 DID (default), 5 T38, 6 VOICEML, 8 SDN, 9 MOBILE.
|
|
15
17
|
OrderNumberSpec = Data.define(:number, :route) do
|
|
16
18
|
include Request
|
|
17
19
|
end
|
|
@@ -5,12 +5,16 @@ require_relative "base"
|
|
|
5
5
|
module VoiceTel
|
|
6
6
|
module Models
|
|
7
7
|
# ------------------------------------------------------------- requests ---
|
|
8
|
-
# Body for POST /v2.2/numbers.
|
|
8
|
+
# Body for POST /v2.2/numbers. route is the global route type: 1 USER,
|
|
9
|
+
# 2 T30, 3 VOICE_BRIDGE, 4 DID (default), 5 T38, 6 VOICEML, 8 SDN,
|
|
10
|
+
# 9 MOBILE.
|
|
9
11
|
NumberAddRequest = Data.define(:number, :route) do
|
|
10
12
|
include Request
|
|
11
13
|
end
|
|
12
14
|
|
|
13
|
-
# Body for PUT /v2.2/numbers/{number}/route.
|
|
15
|
+
# Body for PUT /v2.2/numbers/{number}/route. route is the global route
|
|
16
|
+
# type: 1 USER, 2 T30, 3 VOICE_BRIDGE, 4 DID (default), 5 T38, 6 VOICEML,
|
|
17
|
+
# 8 SDN, 9 MOBILE.
|
|
14
18
|
NumberRouteRequest = Data.define(:route) do
|
|
15
19
|
include Request
|
|
16
20
|
end
|
|
@@ -61,7 +65,9 @@ module VoiceTel
|
|
|
61
65
|
include Request
|
|
62
66
|
end
|
|
63
67
|
|
|
64
|
-
# Body for PATCH /v2.2/numbers/{number} — move to another account.
|
|
68
|
+
# Body for PATCH /v2.2/numbers/{number} — move to another account. route
|
|
69
|
+
# is the global route type on the destination account: 1 USER, 2 T30,
|
|
70
|
+
# 3 VOICE_BRIDGE, 4 DID (default), 5 T38, 6 VOICEML, 8 SDN, 9 MOBILE.
|
|
65
71
|
NumberMoveRequest = Data.define(:account_id, :route) do
|
|
66
72
|
include Request
|
|
67
73
|
end
|
|
@@ -73,7 +79,9 @@ module VoiceTel
|
|
|
73
79
|
|
|
74
80
|
# ------------------------------------------------- entities & data ---
|
|
75
81
|
# Per-number routing / feature state. Returned by GET /v2.2/numbers and
|
|
76
|
-
# GET /v2.2/numbers/{number}.
|
|
82
|
+
# GET /v2.2/numbers/{number}. route is the global route type: 1 USER,
|
|
83
|
+
# 2 T30, 3 VOICE_BRIDGE, 4 DID (default), 5 T38, 6 VOICEML, 8 SDN,
|
|
84
|
+
# 9 MOBILE.
|
|
77
85
|
NumberDetail = Data.define(
|
|
78
86
|
:number, :translated, :route, :gateway, :cnam, :forward, :forward_to, :carrier,
|
|
79
87
|
:sms_enabled, :fax_enabled
|
|
@@ -114,7 +122,9 @@ module VoiceTel
|
|
|
114
122
|
end
|
|
115
123
|
end
|
|
116
124
|
|
|
117
|
-
# Data payload from POST /v2.2/numbers.
|
|
125
|
+
# Data payload from POST /v2.2/numbers. route is the global route type
|
|
126
|
+
# that was installed: 1 USER, 2 T30, 3 VOICE_BRIDGE, 4 DID (default),
|
|
127
|
+
# 5 T38, 6 VOICEML, 8 SDN, 9 MOBILE.
|
|
118
128
|
NumberAddData = Data.define(:number, :route) do
|
|
119
129
|
extend Base
|
|
120
130
|
end
|
|
@@ -145,12 +155,16 @@ module VoiceTel
|
|
|
145
155
|
extend Base
|
|
146
156
|
end
|
|
147
157
|
|
|
148
|
-
# Data payload from PATCH /v2.2/numbers/{number}.
|
|
158
|
+
# Data payload from PATCH /v2.2/numbers/{number}. route is the global
|
|
159
|
+
# route type on the destination account: 1 USER, 2 T30, 3 VOICE_BRIDGE,
|
|
160
|
+
# 4 DID (default), 5 T38, 6 VOICEML, 8 SDN, 9 MOBILE.
|
|
149
161
|
NumberMoveData = Data.define(:number, :account_id, :route) do
|
|
150
162
|
extend Base
|
|
151
163
|
end
|
|
152
164
|
|
|
153
|
-
# Data payload from PUT /v2.2/numbers/{number}/route.
|
|
165
|
+
# Data payload from PUT /v2.2/numbers/{number}/route. route echoes the
|
|
166
|
+
# applied global route type: 1 USER, 2 T30, 3 VOICE_BRIDGE, 4 DID
|
|
167
|
+
# (default), 5 T38, 6 VOICEML, 8 SDN, 9 MOBILE.
|
|
154
168
|
NumberRouteData = Data.define(:number, :route) do
|
|
155
169
|
extend Base
|
|
156
170
|
end
|
|
@@ -178,8 +192,8 @@ module VoiceTel
|
|
|
178
192
|
# sharing record): "B" (assigned synchronously) or "C" (provisioned
|
|
179
193
|
# asynchronously, status "pending").
|
|
180
194
|
#
|
|
181
|
-
# upstream_cnp_id — CNP ID from the CSP sharing record:
|
|
182
|
-
# B, BANDW = path C. (Campaigns on path A,
|
|
195
|
+
# upstream_cnp_id — CNP ID from the CSP sharing record: CAMP003 = path
|
|
196
|
+
# B, BANDW = path C. (Campaigns on path A, CAMP004, are being migrated
|
|
183
197
|
# and take no new numbers.)
|
|
184
198
|
#
|
|
185
199
|
# carrier — outbound carrier id the number routes through once enabled
|
data/lib/voicetel/version.rb
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module VoiceTel
|
|
4
4
|
# The semantic version of the VoiceTel Ruby SDK. This tracks the API version
|
|
5
|
-
# it targets (currently v2.2.
|
|
6
|
-
VERSION = "2.2.
|
|
5
|
+
# it targets (currently v2.2.17).
|
|
6
|
+
VERSION = "2.2.17"
|
|
7
7
|
|
|
8
8
|
# The VoiceTel REST API version this SDK targets.
|
|
9
|
-
API_VERSION = "v2.2.
|
|
9
|
+
API_VERSION = "v2.2.17"
|
|
10
10
|
|
|
11
11
|
# Default production API endpoint.
|
|
12
12
|
DEFAULT_BASE_URL = "https://api.voicetel.com"
|