sinch_sms 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinch_sms.rb +11 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7120041fd731da04fc0a99f1ffba2404ebc9f71f
|
4
|
+
data.tar.gz: 2d4955c592e411b1f4ab9fdf7bb45d23a742658b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff0ad320f2ff8b53b5d6ff28eb33b59da05cd399329f712e4f4a827430004c372f18fd0a6f774dfc3a250bb1b942bdfb3d19010eb3d5a787a6dbf536c7886aa5
|
7
|
+
data.tar.gz: 692b847ba1a8f7fc40c649a472cc104776f6197e066f063bd4983107864a8231052cb8369654ebfd16a7081a1a37d7f89df6300755e67f9828cf9eec4f50fa3f
|
data/lib/sinch_sms.rb
CHANGED
@@ -8,7 +8,7 @@ class SinchSms
|
|
8
8
|
req = Net::HTTP::Post.new("/v1/sms/" + to)
|
9
9
|
http.use_ssl = true
|
10
10
|
req.basic_auth "application:" + key, secret
|
11
|
-
req["Content-Type"] = "
|
11
|
+
req["Content-Type"] = "application/json"
|
12
12
|
|
13
13
|
if (from)
|
14
14
|
req.body = {"Message" => message, "From" => from}.to_json
|
@@ -16,14 +16,16 @@ class SinchSms
|
|
16
16
|
req.body = {"Message" => message}.to_json
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
return http.request(req).body
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.status(key, secret, id)
|
23
|
+
http = Net::HTTP.new("messagingApi.sinch.com",443)
|
24
|
+
req = Net::HTTP::Get.new("/v1/message/status/" + id)
|
25
|
+
http.use_ssl = true
|
26
|
+
req.basic_auth "application:" + key, secret
|
27
|
+
req["Content-Type"] = "application/json"
|
27
28
|
|
29
|
+
return http.request(req).body
|
28
30
|
end
|
29
31
|
end
|