sendout 0.1.2 → 0.1.3
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 +39 -8
- data/lib/sendout.rb +6 -2
- data/lib/sendout/version.rb +1 -1
- metadata +3 -4
- data/lib/.sendout.rb.swp +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b942cb5181754d28879f979624d093078c116323
|
4
|
+
data.tar.gz: 09be7f4eaacdd24a507e727284cf0082342e9a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2797a0fb0e09fea41df47268fcbb33e7a43e0a7cfbb946b5a331e6f9d895e5e71078fdb7cb7c6d67dda676fcd87ff81f830def1aedc26c2e8eb34646fc0a9117
|
7
|
+
data.tar.gz: 798645276c433566df88625c2c4b21e1283242ee79bbd29fcd6b3bae1482db6b809741d86ae4485aa716d73834a33c03976b7d0f595cdf546cb2cacc61ce3ca0
|
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
A ruby gem createb by [SmartTechys](http://www.smarttechys.co.ao) for the [SendOut](https://www.sendoutapp.com) API that allows your application to send text messages (Angolan and International).
|
4
4
|
|
5
|
+
## ATTENTION
|
6
|
+
* **API Version 1 - Gem sendout v0.1.1**
|
7
|
+
* **API Version 2 - Gem sendout v0.1.2**
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
@@ -41,25 +45,52 @@ Sendout.check_balance
|
|
41
45
|
|
42
46
|
# It will return a json
|
43
47
|
|
44
|
-
{
|
45
|
-
"cliente":
|
46
|
-
|
47
|
-
|
48
|
-
|
48
|
+
{
|
49
|
+
"cliente": "2449XXXXXXXX"
|
50
|
+
"saldo": "512"
|
51
|
+
"enviadas": "203"
|
52
|
+
"contactos": "2"
|
53
|
+
"campanhas": "1"
|
49
54
|
}
|
50
55
|
```
|
51
56
|
|
52
|
-
### Send one or bulk message
|
57
|
+
### Send one or bulk message - Production Environment
|
53
58
|
|
54
59
|
```ruby
|
55
60
|
Sendout.send_sms(num, msg)
|
56
61
|
|
57
|
-
# The num has to be an array and the msg an string. This method will return
|
62
|
+
# The num has to be an array and the msg an string. This method will return an array of one or more JSON objects.
|
63
|
+
```
|
64
|
+
Response:
|
65
|
+
```JSON
|
66
|
+
[
|
67
|
+
{
|
68
|
+
"id":"0800000018E1C4DA",
|
69
|
+
"de":"2449XXXXXXX5",
|
70
|
+
"para":"2449XXXXXXX0",
|
71
|
+
"remetente":"SENDOUT",
|
72
|
+
"caracteres":"24",
|
73
|
+
"quantidade":"1",
|
74
|
+
"data":"07-01-2017 18:59:37",
|
75
|
+
"rede":"00000",
|
76
|
+
"enviado":true,
|
77
|
+
"estado":"Entregue"
|
78
|
+
}
|
79
|
+
]
|
58
80
|
```
|
81
|
+
### Send one or bulk message - Test Environment
|
82
|
+
You need to add a boolean value true to send as test; if nothing or false will send it to production
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
Sendout.send_sms(num, true, msg)
|
86
|
+
|
87
|
+
# The num has to be an array and the msg an string. This method will return an array of one or more JSON objects
|
88
|
+
```
|
89
|
+
|
59
90
|
## Help and Docs
|
60
91
|
|
61
92
|
- [SendOut](https://www.sendoutapp.com)
|
62
|
-
- [RDoc](https://www.rubydoc.info/gems/0.1.
|
93
|
+
- [RDoc](https://www.rubydoc.info/gems/0.1.2)
|
63
94
|
|
64
95
|
## Development
|
65
96
|
|
data/lib/sendout.rb
CHANGED
@@ -10,11 +10,15 @@ module Sendout
|
|
10
10
|
def self.check_balance
|
11
11
|
post("/saldo", {:body => authenticate.to_json, :headers => {'Content-Type' => 'application/json'}}).parsed_response
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
# send sms: dest is always an array of numbers and the message a string
|
15
15
|
def self.send_sms(numbers=[], debug={}, message)
|
16
16
|
# fields from API
|
17
|
-
|
17
|
+
if debug == false
|
18
|
+
data = {"para" => numbers, "sms" => message}
|
19
|
+
else
|
20
|
+
data = {"para" => numbers, "sms" => message, "debug" => debug}
|
21
|
+
end
|
18
22
|
|
19
23
|
# merge the body content
|
20
24
|
content = {}
|
data/lib/sendout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Maziano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,7 +82,6 @@ files:
|
|
82
82
|
- Rakefile
|
83
83
|
- bin/console
|
84
84
|
- bin/setup
|
85
|
-
- lib/.sendout.rb.swp
|
86
85
|
- lib/sendout.rb
|
87
86
|
- lib/sendout/version.rb
|
88
87
|
- sendout.gemspec
|
@@ -106,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
105
|
version: '0'
|
107
106
|
requirements: []
|
108
107
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.6.
|
108
|
+
rubygems_version: 2.6.7
|
110
109
|
signing_key:
|
111
110
|
specification_version: 4
|
112
111
|
summary: A Ruby gem for SendOut API(https://www.sendoutapp.com) made by SmartTechys(http://smarttechys.co.ao).
|
data/lib/.sendout.rb.swp
DELETED
Binary file
|