@@ -2,7 +2,7 @@ MessageBird's REST API for Ruby
22===============================
33This repository contains the open source Ruby client for MessageBird's REST API. Documentation can be found at: https://developers.messagebird.com/
44
5- [ ![ Build Status] ( https://travis-ci.org /messagebird/ruby-rest-api. svg?branch=master )] ( https://travis-ci.org /messagebird/ruby-rest-api )
5+ [ ![ Build Status] ( https://github.com /messagebird/ruby-rest-api/actions/workflows/ruby_ci.yml/badge. svg )] ( https://github.com /messagebird/ruby-rest-api/actions )
66
77Requirements
88------------
@@ -58,7 +58,7 @@ pp client.message_create('FromMe', '31612345678', 'Hello World', :reference => '
5858
5959# <MessageBird::Message:0x007f8d5b883520
6060 @body = " Hello World" ,
61- @createdDatetime = 2014 - 07 - 07 12 :20 :30 + 0200 ,
61+ @created_datetime = 2014 - 07 - 07 12 :20 :30 + 0200 ,
6262 @datacoding = " plain" ,
6363 @direction = " mt" ,
6464 @gateway = 239 ,
@@ -68,7 +68,7 @@ pp client.message_create('FromMe', '31612345678', 'Hello World', :reference => '
6868 @mclass = 1 ,
6969 @originator = " FromMe" ,
7070 @recipient =
71- {" totalCount " =>1 ,
71+ {" total_count " =>1 ,
7272 " totalSentCount" =>1 ,
7373 " totalDeliveredCount" =>0 ,
7474 " totalDeliveryFailedCount" =>0 ,
@@ -78,9 +78,9 @@ pp client.message_create('FromMe', '31612345678', 'Hello World', :reference => '
7878 @status = " sent" ,
7979 @statusDatetime = 2014 - 07 - 07 12 :20 :30 + 0200 > ]},
8080 @reference = " MyReference" ,
81- @scheduledDatetime = nil ,
81+ @scheduled_datetime = nil ,
8282 @type = " sms" ,
83- @typeDetails = {},
83+ @type_details = {},
8484 @validity = nil >
8585```
8686
@@ -97,7 +97,7 @@ To perform HLR lookups we have created the **hlr_create** method, which takes a
9797pp client.hlr_create(' 31612345678' , ' MyReference' )
9898
9999# <MessageBird::HLR:0x007f8d5b8dafc8
100- @createdDatetime = 2014 - 07 - 07 12 :20 :05 + 0200 ,
100+ @created_datetime = 2014 - 07 - 07 12 :20 :05 + 0200 ,
101101 @href = " https://rest.messagebird.com/hlr/4933bed0453ba7455031712h16830892" ,
102102 @id = " 4933bed0453ba7455031712h16830892" ,
103103 @msisdn = 31612345678 ,
@@ -126,7 +126,7 @@ client.verify_create(31612345678, {:reference => "YourReference"})
126126 @reference = " YourReference" ,
127127 @status = " sent" ,
128128 @href = {" message" =>" https://rest.messagebird.com/messages/67d42f004555213679416f0b13254392" },
129- @createdDatetime = 2015 - 05 - 12 16 :51 :19 + 0200 ,
129+ @created_datetime = 2015 - 05 - 12 16 :51 :19 + 0200 ,
130130 @validUntilDatetime = 2015 - 05 - 12 16 :51 :49 + 0200 >
131131```
132132
@@ -147,14 +147,14 @@ pp client.voice_message_create('31612345678', 'Hello World', :reference => 'MyRe
147147
148148# <MessageBird::VoiceMessage:0x000001030101b8
149149 @body = " Hello World" ,
150- @createdDatetime = 2014 - 07 - 09 12 :17 :50 + 0200 ,
150+ @created_datetime = 2014 - 07 - 09 12 :17 :50 + 0200 ,
151151 @href =
152152 " https://rest.messagebird.com/voicemessages/a08e51a0353bd16cea7f298a37405850" ,
153153 @id = " a08e51a0353bd16cea7f298a37405850" ,
154154 @ifMachine = " continue" ,
155155 @language = " en-gb" ,
156156 @recipients =
157- {" totalCount " =>1 ,
157+ {" total_count " =>1 ,
158158 " totalSentCount" =>1 ,
159159 " totalDeliveredCount" =>0 ,
160160 " totalDeliveryFailedCount" =>0 ,
@@ -175,6 +175,54 @@ Similar to regular messaging and HLR lookups, there is a method available to fet
175175client.voice_message(' a08e51a0353bd16cea7f298a37405850' )
176176```
177177
178+ ##### Numbers
179+ There is also a Numbers API that allow you to search for and purchase number subscriptions to use as originator in other services.
180+
181+ ``` ruby
182+ pp client.number_search(" NL" , {:limit =>5 })
183+
184+ # <List:0x00007fa405130618
185+ @count = 5 ,
186+ @items =
187+ [# <MessageBird::Number:0x00007fa405130528
188+ @country = " NL" ,
189+ @features = [" voice" ],
190+ @locality = " Rotterdam" ,
191+ @number = " 31102005108" ,
192+ @region = " " ,
193+ @type = " unknown" > ,
194+ # <MessageBird::Number:0x00007fa4051303c0
195+ @country = " NL" ,
196+ @features = [" voice" ],
197+ @locality = " Rotterdam" ,
198+ @number = " 31102005143" ,
199+ @region = " " ,
200+ @type = " unknown" > ,
201+ # <MessageBird::Number:0x00007fa405130208
202+ @country = " NL" ,
203+ @features = [" voice" ],
204+ @locality = " Rotterdam" ,
205+ @number = " 31102005145" ,
206+ @region = " " ,
207+ @type = " unknown" > ,
208+ # <MessageBird::Number:0x00007fa4051300c8
209+ @country = " NL" ,
210+ @features = [" voice" ],
211+ @locality = " Rotterdam" ,
212+ @number = " 31102005147" ,
213+ @region = " " ,
214+ @type = " unknown" > ,
215+ # <MessageBird::Number:0x00007fa405131c48
216+ @country = " NL" ,
217+ @features = [" voice" ],
218+ @locality = " Rotterdam" ,
219+ @number = " 31102005148" ,
220+ @region = " " ,
221+ @type = " unknown" > ],
222+ @limit = 5 ,
223+ @type = MessageBird ::Number >
224+ ````
225+
178226Documentation
179227-------------
180228Complete documentation, instructions, and examples are available at:
0 commit comments