direct7 0.0.18 → 0.0.19
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 +13 -1
- data/VERSION +1 -1
- data/direct7.gemspec +1 -1
- data/lib/direct7/whatsapp.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11f51674260516e4102d49cba7501c1ee1f1e89a112e354208ef1b8958f1f220
|
4
|
+
data.tar.gz: 4a52fbe1a22b315d1036c99db2af187034811acbbd3a0797d5bceb6985e2a007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9bbbbdea1f94763d740d982e6903fc01bbd5156701f559e6cd85847e59f8c45edbdad6c3ed4ed4c81df77835c4764e605cea4321049aec6d4affe0ac8da15fb
|
7
|
+
data.tar.gz: 8a65fbe52b6873080990219f81ecbfce716a16fce54d0f322dbc82cdd74a920b64f4ddfd6cb3a7f943c1a1b5fc08d4623152517a1f779db6ddeeff5db66fe67f
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ The SDK is available on RubyGems and can be installed using two methods:
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
10
|
```bash
|
11
|
-
gem 'direct7', '~> 0.0.
|
11
|
+
gem 'direct7', '~> 0.0.19'
|
12
12
|
```
|
13
13
|
|
14
14
|
And then execute:
|
@@ -247,6 +247,18 @@ client = Direct7::Client.new('Your API token')
|
|
247
247
|
client.whatsapp.read_receipt(message_id="9612c7f5-2ba5-49db-8901-4ee9be6dc8d1")
|
248
248
|
```
|
249
249
|
|
250
|
+
### Download Media
|
251
|
+
|
252
|
+
```ruby
|
253
|
+
require 'direct7'
|
254
|
+
|
255
|
+
client = Direct7::Client.new('Your API token')
|
256
|
+
|
257
|
+
# message_id is the id shown in the api reports
|
258
|
+
client.whatsapp.download_media(media_id="165543534343")
|
259
|
+
```
|
260
|
+
|
261
|
+
|
250
262
|
## FAQ
|
251
263
|
|
252
264
|
### How do I get my API token?
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.19
|
data/direct7.gemspec
CHANGED
@@ -4,7 +4,7 @@ require "direct7/version"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "direct7"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.19"
|
8
8
|
spec.authors = ["Direct7 Networks"]
|
9
9
|
spec.email = ["support@d7networks.com"]
|
10
10
|
spec.summary = "Ruby SDK for Direct7 Platform REST API"
|
data/lib/direct7/whatsapp.rb
CHANGED
@@ -248,5 +248,14 @@ module Direct7
|
|
248
248
|
@log.info('Message marked as read successfully.')
|
249
249
|
response
|
250
250
|
end
|
251
|
+
|
252
|
+
def download_media(media_id)
|
253
|
+
response = @client.get(
|
254
|
+
@client.host,
|
255
|
+
"/whatsapp/v2/download/#{media_id}"
|
256
|
+
)
|
257
|
+
@log.info('Successfully downloaded media.')
|
258
|
+
response
|
259
|
+
end
|
251
260
|
end
|
252
261
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: direct7
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Direct7 Networks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|