crisp-api 1.1.1 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73edc201f441670de7a0a5f19f264e9cd63dbdd2
4
- data.tar.gz: d9a70ac91e7d86a5a4e37776cadf9257ed18427c
3
+ metadata.gz: c6da906fecbb573028bc50f9f5a6fdb1e7131b27
4
+ data.tar.gz: 8e46bdc80cd1ef7745771dd229e002a8989f49cd
5
5
  SHA512:
6
- metadata.gz: 06e95d148d771c58a47908bcaf5fedbf61d658e9508b63d134eb92ec324d2efeda2eca1dbb13dff1e6214596f1a3a456683e86d64e3c6ac38fcc4a1ccdb75a5b
7
- data.tar.gz: dad99b1c1f8756531d5f6bfef3ce0684b35ac6a475763d9added5c6890829ec842abf6ad3ecbdcefd55b27ccbbff5c4f5402eb9cccfe68ebb8b4e90ecba984cd
6
+ metadata.gz: 74f5276f53b7067db9de22764af31684333f0a20eeddac02608e8fc61b749e9e6e7b8f0854c153f617e7edb89aaf0c739cc85714f3a5d0cb14a748576365c58a
7
+ data.tar.gz: 87a91dabd071566909b030b59e79f4b3e99b6320060f6a6fb469260c26cbc26267397e24c2a0cd9624e31cf9e2699b04af2afe28f3effeb6b3e8253094388aba
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Crisp API Ruby wrapper. Authenticate, send messages, fetch conversations, access your agent accounts from your Ruby code.
4
4
 
5
- Copyright 2018 Crisp IM SARL. See LICENSE for copying information.
5
+ Copyright 2019 Crisp IM SARL. See LICENSE for copying information.
6
6
 
7
7
  * **📝 Implements**: [Crisp Platform - API ~ v1](https://docs.crisp.chat/api/v1/) at reference revision: 12/31/2017
8
8
  * **😘 Maintainer**: [@valeriansaliou](https://github.com/valeriansaliou)
@@ -114,7 +114,7 @@ client.website.send_message_in_conversation(
114
114
  * **Check If People Profile Exists**: `client.website.check_people_profile_exists(website_id, people_id)`
115
115
  * **Get People Profile**: `client.website.get_people_profile(website_id, people_id)`
116
116
  * **Save People Profile**: `client.website.save_people_profile(website_id, people_id, data)`
117
- * **Find People Profile By Email**: `find_people_profile_by_email(website_id, email)`
117
+ * **Find People Profile By Email**: `client.website.find_people_profile_by_email(website_id, email)`
118
118
  * **Update People Profile**: `client.website.update_people_profile(website_id, people_id, data)`
119
119
  * **Remove People Profile**: `client.website.remove_people_profile(website_id, people_id)`
120
120
  * **List People Conversations**: `client.website.list_people_conversations(website_id, people_id, page_number)`
@@ -149,8 +149,10 @@ client.website.send_message_in_conversation(
149
149
  * **Website Visitors**
150
150
  * **Count Visitors**: `client.website.count_visitors(website_id)`
151
151
  * **List Visitors**: `client.website.list_visitors(website_id, page_number)`
152
+ * **Get Session ID**: `client.website.get_session_id_from_token(website_id, token)`
152
153
 
153
154
  ### Bucket
154
155
 
155
156
  * **Bucket URL**
156
157
  * **Generate Bucket URL**: `client.bucket.generate_bucket_url(data)`
158
+
@@ -2,7 +2,7 @@ require File.expand_path("../lib/crisp-api", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'crisp-api'
5
- s.version = '1.1.1'
5
+ s.version = '1.1.2'
6
6
  s.date = Date.today
7
7
  s.summary = "Crisp API Ruby"
8
8
  s.description = "Crisp API Ruby"
@@ -86,7 +86,7 @@ module Crisp
86
86
  :payload => (data ? data.to_json : nil),
87
87
 
88
88
  :headers => {
89
- :user_agent => "ruby-crisp-api/1.1.1",
89
+ :user_agent => "ruby-crisp-api/1.1.2",
90
90
  :accept => :json,
91
91
  :content_type => :json,
92
92
  :params => query
@@ -194,10 +194,7 @@ module Crisp
194
194
  end
195
195
 
196
196
  def find_people_profile_by_email(website_id, email)
197
- filter = [{:model => "people", :criterion => "email", :operator => "eq", query: [email]}]
198
- profiles = @parent.get(self._url_website(website_id, "/people/profiles/1?search_filter=%s" % CGI.escape(filter.to_json)))
199
-
200
- return profiles[0]
197
+ return @parent.get(self._url_people("profile", website_id, email, ""))
201
198
  end
202
199
 
203
200
  def get_people_profile(website_id, people_id)
@@ -243,5 +240,9 @@ module Crisp
243
240
  def update_people_subscription_status(website_id, people_id, data)
244
241
  return @parent.patch(self._url_people("subscription", website_id, people_id, ""), data: data)
245
242
  end
243
+
244
+ def get_session_id_by_token(website_id, token)
245
+ return @parent.get(self._url_website(website_id, "/visitors/token/#{token}"))
246
+ end
246
247
  end
247
248
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crisp-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valerian Saliou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-24 00:00:00.000000000 Z
11
+ date: 2019-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client